R64 A1-A6:新员工入门引导

这个提交包含在:
2026-04-14 16:45:10 +08:00
父节点 86644a6766
当前提交 7ac0de660c
共修改 12 个文件,包含 453 行新增和 5 行删除
+7
查看文件
@@ -47,6 +47,13 @@ export type MeResponse = {
email: string;
roleCodes: string[];
permissions: string[];
profileCompleteness?: {
hasEmergencyContact: boolean;
hasBankAccount: boolean;
hasAvatar: boolean;
hasIdNumber: boolean;
score: number;
};
};
export type AuthenticatedApiClient = {
+31
查看文件
@@ -1,6 +1,7 @@
import { expect, test } from "@playwright/test";
import { EMPLOYEE, login } from "./helpers/auth";
import { TEST_IDS } from "./helpers/testIds";
const ADMIN = { identifier: "[email protected]", password: "AdminPassword1234", name: "Admin" };
@@ -25,7 +26,15 @@ function mockMe(page: import("@playwright/test").Page, roleCodes: string[], name
departmentId: "dept-1",
directManagerId: null,
status: "active",
notificationPushEnabled: true,
roleCodes,
profileCompleteness: {
hasEmergencyContact: true,
hasBankAccount: true,
hasAvatar: false,
hasIdNumber: false,
score: 50,
},
wecomBinding: null,
})),
});
@@ -258,6 +267,28 @@ test("Portal 管理视角重排正确,备用模块默认折叠", async ({ page
await expect(page.getByRole("link", { name: "采购申请" })).toBeVisible();
});
test("Portal 新员工引导先显示欢迎弹窗,再显示快速上手清单", async ({ page }) => {
await page.addInitScript(() => {
window.localStorage.setItem("hyb_oa_show_welcome", "1");
window.localStorage.setItem("hyb_oa_onboarding_active", "1");
window.localStorage.removeItem("hyb_oa_getting_started_dismissed");
});
await mockNavigation(page, "employee");
await mockPortalHome(page, "employee");
await mockAttendanceToday(page);
await mockMe(page, ["employee"], "Employee");
await login(page, EMPLOYEE);
await expect(page.getByTestId(TEST_IDS.onboarding.welcomeDialog)).toBeVisible();
await page.getByTestId(TEST_IDS.onboarding.welcomeClose).click();
await expect(page.getByTestId(TEST_IDS.onboarding.welcomeDialog)).not.toBeVisible();
await expect(page.getByTestId(TEST_IDS.onboarding.gettingStartedCard)).toBeVisible();
await page.getByTestId(TEST_IDS.onboarding.gettingStartedDismiss).click();
await expect(page.getByTestId(TEST_IDS.onboarding.gettingStartedCard)).not.toBeVisible();
});
test("Portal 域管理角色也进入经理视图", async ({ page }) => {
await mockNavigation(page, "manager");
await mockPortalHome(page, "manager");