mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-13 14:32:03 +00:00
fix(admin): read a geolocation provider the operator named as a decision, not a warning
This commit is contained in:
1 parent
88836452eb
commit
0a6811c03f
16 files changed
+157
-14
No files matched your search
@@ -0,0 +1,41 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { geoLookupState, type PublicVersion } from "../_shared";
|
||||
|
||||
const base: PublicVersion = {
|
||||
version: "1.42.0",
|
||||
buildSha: null,
|
||||
builtAt: null,
|
||||
};
|
||||
|
||||
describe("geoLookupState", () => {
|
||||
it("warns only about the unconfigured default provider", () => {
|
||||
expect(
|
||||
geoLookupState({
|
||||
...base,
|
||||
offlineGeoEnabled: false,
|
||||
geoLookup: "online",
|
||||
}),
|
||||
).toBe("default");
|
||||
});
|
||||
|
||||
it("treats a provider the operator named as a decision", () => {
|
||||
expect(
|
||||
geoLookupState({
|
||||
...base,
|
||||
offlineGeoEnabled: false,
|
||||
geoLookup: "online",
|
||||
geoProviderChosen: true,
|
||||
}),
|
||||
).toBe("chosen");
|
||||
});
|
||||
|
||||
it("reads a switched-off lookup and the offline databases as settled", () => {
|
||||
expect(
|
||||
geoLookupState({ ...base, offlineGeoEnabled: false, geoLookup: "off" }),
|
||||
).toBe("off");
|
||||
expect(geoLookupState({ ...base, offlineGeoEnabled: true })).toBe(
|
||||
"offline",
|
||||
);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user