fix: an issue

This commit is contained in:
Nathnael
2026-08-12 07:11:27 +00:00
parent a603807e8e
commit d4767e0d06
16 changed files with 206 additions and 177 deletions

View File

@@ -0,0 +1,28 @@
import { describe, expect, it } from "vitest";
import { documentSettingCode } from "./documentSettingCode";
describe("documentSettingCode", () => {
it("resolves the nationality set", () => {
expect(documentSettingCode("ethiopian")).toBe(
"company_onboarding_documents_ethiopian",
);
expect(documentSettingCode("foreign")).toBe(
"company_onboarding_documents_foreign",
);
expect(documentSettingCode(null)).toBe(
"company_onboarding_documents_ethiopian",
);
});
it("replaces the nationality set for a co-operative", () => {
expect(documentSettingCode("ethiopian", true)).toBe(
"company_onboarding_documents_cooperative",
);
// A co-op is never foreign, but a stale flag must not fall back to the
// foreign set — the co-op answer wins.
expect(documentSettingCode("foreign", true)).toBe(
"company_onboarding_documents_cooperative",
);
});
});