forked from baron/baron-sso
feat: improve Worksmobile tenant sync handling
This commit is contained in:
@@ -4,6 +4,7 @@ import {
|
||||
buildAuthenticatedOrgChartUrl,
|
||||
buildOrgChartTenantPickerUrl,
|
||||
filterNonHanmacFamilyTenants,
|
||||
getTenantGradeOptions,
|
||||
isHanmacFamilyUser,
|
||||
parseOrgChartTenantSelection,
|
||||
} from "./orgChartPicker";
|
||||
@@ -114,6 +115,22 @@ describe("orgChartPicker", () => {
|
||||
type: "COMPANY",
|
||||
parentId: undefined,
|
||||
},
|
||||
{
|
||||
id: "internal-id",
|
||||
slug: "internal",
|
||||
name: "Internal",
|
||||
type: "COMPANY",
|
||||
parentId: undefined,
|
||||
config: { visibility: "internal" },
|
||||
},
|
||||
{
|
||||
id: "private-id",
|
||||
slug: "private",
|
||||
name: "Private",
|
||||
type: "COMPANY",
|
||||
parentId: undefined,
|
||||
visibility: "private",
|
||||
},
|
||||
{
|
||||
id: "hanmac-family-id",
|
||||
slug: "hanmac-family",
|
||||
@@ -249,4 +266,54 @@ describe("orgChartPicker", () => {
|
||||
),
|
||||
).toBe(false);
|
||||
});
|
||||
|
||||
it("returns GPDTDC rank options for GPDTDC subtree and general Hanmac ranks otherwise", () => {
|
||||
const tenants = [
|
||||
{
|
||||
id: "hanmac-family-id",
|
||||
slug: "hanmac-family",
|
||||
name: "한맥가족",
|
||||
type: "COMPANY_GROUP",
|
||||
parentId: undefined,
|
||||
},
|
||||
{
|
||||
id: "gpdtdc-id",
|
||||
slug: "gpdtdc",
|
||||
name: "총괄기획&기술개발센터",
|
||||
type: "COMPANY",
|
||||
parentId: "hanmac-family-id",
|
||||
},
|
||||
{
|
||||
id: "gpdtdc-team-id",
|
||||
slug: "gpdtdc-team",
|
||||
name: "연구팀",
|
||||
type: "USER_GROUP",
|
||||
parentId: "gpdtdc-id",
|
||||
},
|
||||
{
|
||||
id: "hanmac-id",
|
||||
slug: "hanmac",
|
||||
name: "한맥기술",
|
||||
type: "COMPANY",
|
||||
parentId: "hanmac-family-id",
|
||||
},
|
||||
];
|
||||
|
||||
expect(
|
||||
getTenantGradeOptions({ tenantId: "gpdtdc-team-id" }, tenants),
|
||||
).toEqual(["연구원", "선임", "책임", "수석", "부사장", "사장"]);
|
||||
expect(getTenantGradeOptions({ tenantSlug: "hanmac" }, tenants)).toEqual([
|
||||
"사원",
|
||||
"대리",
|
||||
"과장",
|
||||
"차장",
|
||||
"부장",
|
||||
"이사",
|
||||
"상무",
|
||||
"전무",
|
||||
"부사장",
|
||||
"사장",
|
||||
"회장",
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user