Files
prowler/ui/lib/deployment.test.ts
2026-07-23 14:30:27 +01:00

35 lines
851 B
TypeScript

import { afterEach, describe, expect, it, vi } from "vitest";
const importFresh = async () => {
vi.resetModules();
return import("./deployment");
};
describe("enterprise feature flags", () => {
afterEach(() => {
vi.unstubAllEnvs();
});
it("should keep grouped Jira dispatch disabled outside cloud", async () => {
// Given
vi.stubEnv("UI_CLOUD_ENABLED", "false");
// When
const { isGroupedJiraDispatchEnabled } = await importFresh();
// Then
expect(isGroupedJiraDispatchEnabled()).toBe(false);
});
it("should enable grouped Jira dispatch in cloud without an enterprise flag", async () => {
// Given
vi.stubEnv("UI_CLOUD_ENABLED", "true");
// When
const { isGroupedJiraDispatchEnabled } = await importFresh();
// Then
expect(isGroupedJiraDispatchEnabled()).toBe(true);
});
});