update settings service tests
This commit is contained in:
1 parent
3dbad1743a
commit
0322a96090
1 file changed
+18
@@ -15,6 +15,7 @@ const makeEnv = (overrides?: Partial<ValidatedEnv>): ValidatedEnv =>
|
|||||||
CLIENT_HOST: "http://localhost:5173",
|
CLIENT_HOST: "http://localhost:5173",
|
||||||
DB_CONNECTION_STRING: "mongodb://localhost:27017/test_db",
|
DB_CONNECTION_STRING: "mongodb://localhost:27017/test_db",
|
||||||
DB_TYPE: "mongodb",
|
DB_TYPE: "mongodb",
|
||||||
|
STATUS_PAGE_THEMES_ENABLED: false,
|
||||||
...overrides,
|
...overrides,
|
||||||
}) as ValidatedEnv;
|
}) as ValidatedEnv;
|
||||||
|
|
||||||
@@ -81,6 +82,7 @@ describe("SettingsService", () => {
|
|||||||
clientHost: "http://localhost:5173",
|
clientHost: "http://localhost:5173",
|
||||||
dbConnectionString: "mongodb://localhost:27017/test_db",
|
dbConnectionString: "mongodb://localhost:27017/test_db",
|
||||||
dbType: "mongodb",
|
dbType: "mongodb",
|
||||||
|
statusPageThemesEnabled: false,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -103,6 +105,22 @@ describe("SettingsService", () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// ── areStatusPageThemesEnabled ──────────────────────────────────────────
|
||||||
|
|
||||||
|
describe("areStatusPageThemesEnabled", () => {
|
||||||
|
it("returns false when STATUS_PAGE_THEMES_ENABLED env is false", () => {
|
||||||
|
const { service } = createService({ STATUS_PAGE_THEMES_ENABLED: false });
|
||||||
|
|
||||||
|
expect(service.areStatusPageThemesEnabled()).toBe(false);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("returns true when STATUS_PAGE_THEMES_ENABLED env is true", () => {
|
||||||
|
const { service } = createService({ STATUS_PAGE_THEMES_ENABLED: true });
|
||||||
|
|
||||||
|
expect(service.areStatusPageThemesEnabled()).toBe(true);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
// ── setRepository ───────────────────────────────────────────────────────
|
// ── setRepository ───────────────────────────────────────────────────────
|
||||||
|
|
||||||
describe("setRepository", () => {
|
describe("setRepository", () => {
|
||||||
|
|||||||
Reference in new issue
Block a user