forked from baron/baron-sso
feat: improve Worksmobile tenant sync handling
This commit is contained in:
@@ -4,6 +4,7 @@ import {
|
||||
mergeTenantOrgConfig,
|
||||
ORG_UNIT_TYPE_OPTIONS,
|
||||
readTenantOrgConfig,
|
||||
removeTenantOrgConfig,
|
||||
shouldAllowHanmacOrgConfig,
|
||||
} from "./orgConfig";
|
||||
|
||||
@@ -49,17 +50,69 @@ describe("tenant org config", () => {
|
||||
it("reads and writes tenant visibility and org unit type", () => {
|
||||
expect(
|
||||
readTenantOrgConfig({ visibility: "private", orgUnitType: "팀" }),
|
||||
).toEqual({ orgUnitType: "팀", visibility: "private" });
|
||||
).toEqual({
|
||||
orgUnitType: "팀",
|
||||
visibility: "private",
|
||||
worksmobileExcluded: false,
|
||||
});
|
||||
expect(
|
||||
readTenantOrgConfig({ visibility: "internal", orgUnitType: "센터" }),
|
||||
).toEqual({ orgUnitType: "센터", visibility: "internal" });
|
||||
).toEqual({
|
||||
orgUnitType: "센터",
|
||||
visibility: "internal",
|
||||
worksmobileExcluded: false,
|
||||
});
|
||||
|
||||
expect(
|
||||
mergeTenantOrgConfig(
|
||||
{ userSchema: [], visibility: "private", orgUnitType: "팀" },
|
||||
{ orgUnitType: "", visibility: "internal" },
|
||||
{
|
||||
orgUnitType: "",
|
||||
visibility: "internal",
|
||||
worksmobileExcluded: false,
|
||||
},
|
||||
),
|
||||
).toEqual({ userSchema: [], visibility: "internal" });
|
||||
).toEqual({
|
||||
userSchema: [],
|
||||
visibility: "internal",
|
||||
worksmobileExcluded: false,
|
||||
});
|
||||
});
|
||||
|
||||
it("reads, writes, and removes the Worksmobile exclusion flag", () => {
|
||||
expect(
|
||||
readTenantOrgConfig({ worksmobileExcluded: true }),
|
||||
).toMatchObject({
|
||||
worksmobileExcluded: true,
|
||||
});
|
||||
expect(
|
||||
readTenantOrgConfig({ worksmobileExcluded: "true" }),
|
||||
).toMatchObject({
|
||||
worksmobileExcluded: true,
|
||||
});
|
||||
expect(
|
||||
mergeTenantOrgConfig(
|
||||
{ userSchema: [], worksmobileExcluded: false },
|
||||
{
|
||||
orgUnitType: "팀",
|
||||
visibility: "private",
|
||||
worksmobileExcluded: true,
|
||||
},
|
||||
),
|
||||
).toEqual({
|
||||
userSchema: [],
|
||||
orgUnitType: "팀",
|
||||
visibility: "private",
|
||||
worksmobileExcluded: true,
|
||||
});
|
||||
expect(
|
||||
removeTenantOrgConfig({
|
||||
userSchema: [],
|
||||
orgUnitType: "팀",
|
||||
visibility: "private",
|
||||
worksmobileExcluded: true,
|
||||
}),
|
||||
).toEqual({ userSchema: [] });
|
||||
});
|
||||
|
||||
it("includes task-force and executive-direct org unit types", () => {
|
||||
|
||||
Reference in New Issue
Block a user