forked from baron/baron-sso
userfront e2e 전체 테스트
This commit is contained in:
@@ -101,4 +101,60 @@ describe("applyGeneralPlanningOfficePriority", () => {
|
||||
employee_id: "EMP001",
|
||||
});
|
||||
});
|
||||
|
||||
it("uses GPDTDC as the Baron representative while keeping the first affiliation primary for WorksMobile", () => {
|
||||
const user: BulkUserItem = {
|
||||
email: "gpdtdc-dual@test.com",
|
||||
name: "GPDTDC Dual User",
|
||||
tenantSlug: "rnd-saman",
|
||||
department: "삼안기술연구소",
|
||||
grade: "책임",
|
||||
metadata: {
|
||||
employee_id: "SAMAN001",
|
||||
},
|
||||
additionalAppointments: [
|
||||
{
|
||||
tenantSlug: "tdc",
|
||||
tenantName: "기술개발센터",
|
||||
grade: "책임연구원",
|
||||
metadata: {
|
||||
employee_id: "B24051",
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
const result = applyGeneralPlanningOfficePriority(user, [
|
||||
tenant("family", "한맥가족사", "hanmac-family"),
|
||||
tenant("gpdtdc", "총괄기획&기술개발센터", "gpdtdc", "family"),
|
||||
tenant("tdc", "기술개발센터", "tdc", "gpdtdc"),
|
||||
tenant("saman", "삼안", "rnd-saman"),
|
||||
]);
|
||||
|
||||
expect(result.tenantSlug).toBe("gpdtdc");
|
||||
expect(result.tenantImport).toMatchObject({
|
||||
slug: "gpdtdc",
|
||||
name: "총괄기획&기술개발센터",
|
||||
});
|
||||
expect(result.metadata.employee_id).toBe("SAMAN001");
|
||||
expect(result.additionalAppointments).toEqual([
|
||||
expect.objectContaining({
|
||||
tenantSlug: "rnd-saman",
|
||||
isPrimary: true,
|
||||
department: "삼안기술연구소",
|
||||
grade: "책임",
|
||||
metadata: {
|
||||
employee_id: "SAMAN001",
|
||||
},
|
||||
}),
|
||||
expect.objectContaining({
|
||||
tenantSlug: "tdc",
|
||||
isPrimary: false,
|
||||
grade: "책임연구원",
|
||||
metadata: {
|
||||
employee_id: "B24051",
|
||||
},
|
||||
}),
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user