feat(P0-A): 整合第一版并冻结最终发布 #1

Open
tuyixuan wants to merge 115 commits from codex/wp7-07 into codex/wp0-09
2 changed files with 39 additions and 2 deletions
Showing only changes of commit 66fe3b763a - Show all commits
+2 -2
View File
@@ -121,7 +121,7 @@ button {
.auth-panel {
width: min(480px, 100%);
margin-left: 84px;
margin-inline: auto;
}
.auth-tabs {
@@ -472,7 +472,7 @@ button {
}
.auth-panel {
margin-left: 0;
margin-inline: 0;
}
.auth-registration-status {
+37
View File
@@ -50,6 +50,12 @@ test("TDD-WP1-NOTICE-001 expands DVPM8 only after successful code delivery", asy
await expect(page.getByRole("checkbox", { name: /同意/ })).not.toBeChecked();
await expect(page.getByRole("button", { name: "注册并进入 Dada" })).toBeDisabled();
const panelBounds = await page.locator(".auth-panel").boundingBox();
const viewport = page.viewportSize();
expect(panelBounds).not.toBeNull();
expect(viewport).not.toBeNull();
expect(Math.abs((panelBounds!.x + panelBounds!.width / 2) - viewport!.width / 2)).toBeLessThanOrEqual(2);
await page.getByRole("button", { name: "查看全文" }).click();
const dialog = page.getByRole("dialog", { name: "内测使用与隐私告知" });
const noticeClose = page.getByRole("button", { name: "我已阅读" });
@@ -117,3 +123,34 @@ test("TDD-WP1-SLOT-001 preserves profile fields when final capacity recheck fail
await expect(page.getByLabel("社交 ID")).toHaveValue("@capacity_user");
await expect(page.getByRole("checkbox", { name: /同意/ })).toBeChecked();
});
test("TDD-WP1-NOTICE-001 hands a successful registration to the workspace route", async ({ page }) => {
await page.route("**/api/v1/auth/register/send", (route) => route.fulfill({
contentType: "application/json",
status: 200,
body: JSON.stringify({
challenge_expires_at: "2026-07-28T09:10:00.000Z",
registration_id: "00000000-0000-4000-8000-000000000006",
resend_available_at: "2026-07-28T09:01:00.000Z",
status: "verification_sent",
}),
}));
await page.route("**/api/v1/auth/register/complete", (route) => route.fulfill({
contentType: "application/json",
status: 200,
body: JSON.stringify({ status: "registered" }),
}));
await page.goto(webUrl);
await page.getByRole("tab", { name: "注册" }).click();
await page.getByRole("textbox", { name: "邀请码" }).fill("DADA-P0A-TEST-4R8");
await page.getByRole("textbox", { name: "邮箱" }).fill("handoff@example.invalid");
await page.getByRole("button", { name: "获取验证码" }).click();
await page.getByLabel("验证码").fill("418205");
await page.getByLabel("创作署名").fill("Handoff User");
await page.getByLabel("社交 ID").fill("@handoff_user");
await page.getByRole("checkbox", { name: /同意/ }).check();
await page.getByRole("button", { name: "注册并进入 Dada" }).click();
await expect(page).toHaveURL(`${webUrl}/app`);
});