forked from baron/baron-sso
feat: update worksmobile sync and restore planning
This commit is contained in:
@@ -97,6 +97,22 @@ test@test.com,Test,local-tenant-id,missing-slug,Missing Tenant,COMPANY,parent-sl
|
||||
});
|
||||
});
|
||||
|
||||
it("should preserve exported user_id for UUID based restore", () => {
|
||||
const csv = `user_id,email,name,tenant_id,tenant_slug
|
||||
9f8cc1b1-af8d-45d4-946c-924a529c2556,restore@test.com,Restore User,tenant-id,restore-tenant`;
|
||||
|
||||
const result = parseUserCSV(csv);
|
||||
|
||||
expect(result).toHaveLength(1);
|
||||
expect(result[0]).toMatchObject({
|
||||
userId: "9f8cc1b1-af8d-45d4-946c-924a529c2556",
|
||||
email: "restore@test.com",
|
||||
name: "Restore User",
|
||||
tenantId: "tenant-id",
|
||||
tenantSlug: "restore-tenant",
|
||||
});
|
||||
});
|
||||
|
||||
it("should parse one nullable additional appointment from numbered columns", () => {
|
||||
const csv = `email,name,phone,role,tenant_slug,department,grade,position,jobTitle,employee_id,tenant_slug1,department1,grade1,position1,jobTitle1,employee_id1
|
||||
dual@test.com,Dual User,010-0000-0000,user,primary-tenant,개발팀,책임,팀장,Backend,EMP001,second-tenant,센터,수석,,Architecture,EMP002
|
||||
@@ -146,4 +162,28 @@ primary@samaneng.com,Primary User,rnd-saman,EMP001,secondary@hanmaceng.co.kr`;
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
it("should mark duplicate bulk alias emails as blocking import errors", () => {
|
||||
const csv = `email,name,tenant_slug,sub_email
|
||||
user1@samaneng.com,User One,rnd-saman,shared@hanmaceng.co.kr
|
||||
user2@samaneng.com,User Two,rnd-saman,shared@hanmaceng.co.kr`;
|
||||
|
||||
const result = parseUserCSV(csv);
|
||||
|
||||
expect(result).toHaveLength(2);
|
||||
expect(result[0].importErrors).toContain("duplicateEmail");
|
||||
expect(result[1].importErrors).toContain("duplicateEmail");
|
||||
});
|
||||
|
||||
it("should mark a primary email reused as a sub email as a blocking import error", () => {
|
||||
const csv = `email,name,tenant_slug,sub_email
|
||||
user1@samaneng.com,User One,rnd-saman,user2@samaneng.com
|
||||
user2@samaneng.com,User Two,rnd-saman,alias@hanmaceng.co.kr`;
|
||||
|
||||
const result = parseUserCSV(csv);
|
||||
|
||||
expect(result).toHaveLength(2);
|
||||
expect(result[0].importErrors).toContain("duplicateEmail");
|
||||
expect(result[1].importErrors).toContain("duplicateEmail");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user