fix: show assistant member gate in place

This commit is contained in:
leefer
2026-07-23 09:01:19 +08:00
parent d22a0f62a1
commit 6350dd3b11
5 changed files with 68 additions and 45 deletions
+10 -3
View File
@@ -191,9 +191,14 @@ test("regular account cannot see admin controls and member features are gated",
await expect(page.locator("#screenerView .member-gate")).toBeVisible();
await expect(page.locator("#screenerRunButton")).toBeDisabled();
await page.locator("#assistantButton").click();
await expect(page.locator("#settingsDialog")).toBeVisible();
await expect(page.locator("#membershipAccessNotice")).toHaveText("复盘助手仅对会员开放");
await expect(page.locator("#membershipAccessNotice")).toBeVisible();
await expect(page.locator("#settingsDialog")).toBeHidden();
await expect(page.locator("#assistantDialog")).toBeVisible();
await expect(page.locator("#assistantMemberGate")).toContainText("复盘助手仅对会员开放");
await expect(page.locator("#assistantMemberGate")).toBeVisible();
await expect(page.locator("#assistantMemberContent")).toHaveAttribute("aria-disabled", "true");
await expect(page.locator("#assistantQuestion")).toBeDisabled();
await expect(page.locator("[data-assistant-prompt]").first()).toBeDisabled();
await expect(page.locator("#sendAssistant")).toBeDisabled();
});
test("stock hover preview ignores the selected historical date", async ({ page }) => {
@@ -236,6 +241,8 @@ test("new review workflows render account-scoped records", async ({ page }) => {
await page.locator("#closeAlertsDialog").click();
await page.locator("#assistantButton").click();
await expect(page.locator("#assistantMemberGate")).toBeHidden();
await expect(page.locator("#assistantMemberContent")).toHaveAttribute("aria-disabled", "false");
await expect(page.locator("#assistantMessages .assistant-message")).toHaveCount(1);
await expect(page.locator("#assistantQuestion")).toBeEnabled();
});