forked from baron/baron-sso
Merge branch 'dev' into feature/issue-919-audit-logs-e2e
This commit is contained in:
@@ -721,10 +721,7 @@ test.describe("User Management", () => {
|
||||
await expect(page.locator("input#department")).toHaveCount(0);
|
||||
|
||||
await expect(page.getByText(/대표 소속/i)).toHaveCount(0);
|
||||
await page
|
||||
.getByRole("tabpanel")
|
||||
.getByRole("button", { name: /^추가$/i })
|
||||
.click();
|
||||
await page.getByTestId("add-appointment-btn").click();
|
||||
await expect(page.getByTestId("appointment-row-0")).toBeVisible();
|
||||
await expect(
|
||||
page.getByTestId("appointment-tenant-owner-line-0"),
|
||||
|
||||
@@ -302,7 +302,10 @@ test.describe("Users Bulk Upload", () => {
|
||||
const payload = JSON.parse(bulkPayload);
|
||||
expect(payload.users[0].tenantSlug).toBe("primary-tenant");
|
||||
expect(payload.users[0].metadata.employee_id).toBe("EMP001");
|
||||
expect(payload.users[0].metadata.sub_email).toEqual([
|
||||
expect(payload.users[0].metadata.sub_email).toBe(
|
||||
"dual.alias@hanmaceng.co.kr",
|
||||
);
|
||||
expect(payload.users[0].metadata.secondary_emails).toEqual([
|
||||
"dual.alias@hanmaceng.co.kr",
|
||||
]);
|
||||
expect(payload.users[0].metadata.aliasEmails).toEqual([
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
import { expect, test } from "@playwright/test";
|
||||
|
||||
type BulkUsersRequest = {
|
||||
users: Array<{
|
||||
metadata: {
|
||||
sub_email?: string[];
|
||||
};
|
||||
}>;
|
||||
};
|
||||
|
||||
test.describe("Users Bulk Upload Secondary Emails", () => {
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await page.addInitScript(() => {
|
||||
@@ -58,11 +66,11 @@ test.describe("Users Bulk Upload Secondary Emails", () => {
|
||||
test("should parse secondary_emails and send to backend", async ({
|
||||
page,
|
||||
}) => {
|
||||
let bulkPayload: Record<string, unknown> | null = null;
|
||||
let bulkPayload: BulkUsersRequest | null = null;
|
||||
|
||||
await page.route("**/api/v1/admin/users/bulk", async (route) => {
|
||||
if (route.request().method() === "POST") {
|
||||
bulkPayload = route.request().postDataJSON() as Record<string, unknown>;
|
||||
bulkPayload = route.request().postDataJSON() as BulkUsersRequest;
|
||||
return route.fulfill({
|
||||
json: {
|
||||
results: [
|
||||
@@ -107,11 +115,7 @@ test.describe("Users Bulk Upload Secondary Emails", () => {
|
||||
await expect(page.getByText(/성공|Success/i)).toBeVisible();
|
||||
|
||||
expect(bulkPayload).not.toBeNull();
|
||||
|
||||
const payloadUsers = bulkPayload?.users as Array<{
|
||||
metadata: { sub_email: string[] };
|
||||
}>;
|
||||
expect(payloadUsers).toHaveLength(1);
|
||||
expect(bulkPayload.users).toHaveLength(1);
|
||||
|
||||
// The most important check - does it parse to the metadata
|
||||
expect(payloadUsers[0].metadata.sub_email).toContain("sub1@test.com");
|
||||
|
||||
Reference in New Issue
Block a user