mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
style: apply Biome formatting to enterprise files
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
import { describe, it, expect } from "vitest";
|
||||
import { canonicalize, computeHmac, verifyHmac } from "../../../apps/api/src/lib/audit-integrity.js";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import {
|
||||
canonicalize,
|
||||
computeHmac,
|
||||
verifyHmac,
|
||||
} from "../../../apps/api/src/lib/audit-integrity.js";
|
||||
|
||||
describe("audit integrity", () => {
|
||||
const testKey = Buffer.from("a".repeat(64), "hex");
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { describe, it, expect } from "vitest";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import {
|
||||
encrypt,
|
||||
decrypt,
|
||||
isEncrypted,
|
||||
deriveAuditHmacKey,
|
||||
encrypt,
|
||||
isEncrypted,
|
||||
} from "../../../apps/api/src/lib/encryption.js";
|
||||
|
||||
describe("encryption", () => {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { ENTERPRISE_FEATURES, PLAN_FEATURES } from "@snapotter/enterprise";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
describe("enterprise feature flags", () => {
|
||||
it("includes all Phase 1 flags", () => {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { describe, it, expect, vi, beforeEach } from "vitest";
|
||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
describe("enterprise mock", () => {
|
||||
beforeEach(() => {
|
||||
@@ -6,9 +6,7 @@ describe("enterprise mock", () => {
|
||||
});
|
||||
|
||||
it("mocks feature enabled", async () => {
|
||||
const { mockEnterpriseFeatures } = await import(
|
||||
"../../helpers/enterprise-mock.js"
|
||||
);
|
||||
const { mockEnterpriseFeatures } = await import("../../helpers/enterprise-mock.js");
|
||||
mockEnterpriseFeatures(["audit_export", "siem_forwarding"]);
|
||||
const { isFeatureEnabled } = await import("@snapotter/enterprise");
|
||||
expect(isFeatureEnabled("audit_export")).toBe(true);
|
||||
@@ -17,18 +15,14 @@ describe("enterprise mock", () => {
|
||||
});
|
||||
|
||||
it("mocks no enterprise", async () => {
|
||||
const { mockNoEnterprise } = await import(
|
||||
"../../helpers/enterprise-mock.js"
|
||||
);
|
||||
const { mockNoEnterprise } = await import("../../helpers/enterprise-mock.js");
|
||||
mockNoEnterprise();
|
||||
const { isFeatureEnabled } = await import("@snapotter/enterprise");
|
||||
expect(isFeatureEnabled("audit_export")).toBe(false);
|
||||
});
|
||||
|
||||
it("returns license payload with correct shape", async () => {
|
||||
const { mockEnterpriseFeatures } = await import(
|
||||
"../../helpers/enterprise-mock.js"
|
||||
);
|
||||
const { mockEnterpriseFeatures } = await import("../../helpers/enterprise-mock.js");
|
||||
mockEnterpriseFeatures(["s3_storage", "mfa"]);
|
||||
const { getActiveLicense } = await import("@snapotter/enterprise");
|
||||
const license = getActiveLicense();
|
||||
@@ -41,9 +35,7 @@ describe("enterprise mock", () => {
|
||||
});
|
||||
|
||||
it("returns null license when no enterprise", async () => {
|
||||
const { mockNoEnterprise } = await import(
|
||||
"../../helpers/enterprise-mock.js"
|
||||
);
|
||||
const { mockNoEnterprise } = await import("../../helpers/enterprise-mock.js");
|
||||
mockNoEnterprise();
|
||||
const { getActiveLicense } = await import("@snapotter/enterprise");
|
||||
expect(getActiveLicense()).toBeNull();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { describe, it, expect, vi, beforeEach, afterEach } from "vitest";
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
describe("webhook delivery", () => {
|
||||
beforeEach(() => {
|
||||
@@ -15,11 +15,9 @@ describe("webhook delivery", () => {
|
||||
vi.stubGlobal("fetch", fetchMock);
|
||||
|
||||
const { deliverWebhook } = await import("../../../apps/api/src/lib/webhook-delivery.js");
|
||||
const result = await deliverWebhook(
|
||||
"https://siem.example.com/input",
|
||||
"Bearer test-token",
|
||||
[{ event: "LOGIN_SUCCESS", timestamp: "2026-01-01T00:00:00Z" }],
|
||||
);
|
||||
const result = await deliverWebhook("https://siem.example.com/input", "Bearer test-token", [
|
||||
{ event: "LOGIN_SUCCESS", timestamp: "2026-01-01T00:00:00Z" },
|
||||
]);
|
||||
|
||||
expect(result.success).toBe(true);
|
||||
expect(result.attempts).toBe(1);
|
||||
|
||||
Reference in New Issue
Block a user