final review
This commit is contained in:
parent
976a880312
commit
92489e5e8a
5 changed files with 13 additions and 77 deletions
|
|
@ -30,13 +30,13 @@ test.describe("Admin Invites Page", () => {
|
||||||
test("godfather selection is a dropdown with users, not a number input", async ({ page }) => {
|
test("godfather selection is a dropdown with users, not a number input", async ({ page }) => {
|
||||||
await page.goto("/admin/invites");
|
await page.goto("/admin/invites");
|
||||||
|
|
||||||
// Wait for users to load
|
|
||||||
await page.waitForSelector("select");
|
|
||||||
|
|
||||||
// The godfather selector should be a <select> element, not an <input type="number">
|
// The godfather selector should be a <select> element, not an <input type="number">
|
||||||
const selectElement = page.locator("select").first();
|
const selectElement = page.locator("select").first();
|
||||||
await expect(selectElement).toBeVisible();
|
await expect(selectElement).toBeVisible();
|
||||||
|
|
||||||
|
// Wait for users to load by checking for a known user in the dropdown
|
||||||
|
await expect(selectElement).toContainText(REGULAR_USER_EMAIL);
|
||||||
|
|
||||||
// Verify it has user options (at least the seeded users)
|
// Verify it has user options (at least the seeded users)
|
||||||
const options = selectElement.locator("option");
|
const options = selectElement.locator("option");
|
||||||
const optionCount = await options.count();
|
const optionCount = await options.count();
|
||||||
|
|
@ -44,9 +44,6 @@ test.describe("Admin Invites Page", () => {
|
||||||
// Should have at least 2 options: placeholder + at least one user
|
// Should have at least 2 options: placeholder + at least one user
|
||||||
expect(optionCount).toBeGreaterThanOrEqual(2);
|
expect(optionCount).toBeGreaterThanOrEqual(2);
|
||||||
|
|
||||||
// Verify the regular user appears as an option
|
|
||||||
await expect(selectElement).toContainText(REGULAR_USER_EMAIL);
|
|
||||||
|
|
||||||
// There should NOT be a number input for godfather ID
|
// There should NOT be a number input for godfather ID
|
||||||
const numberInput = page.locator('input[type="number"]');
|
const numberInput = page.locator('input[type="number"]');
|
||||||
await expect(numberInput).toHaveCount(0);
|
await expect(numberInput).toHaveCount(0);
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,12 @@ async function authenticate(page: Page, request: APIRequestContext): Promise<str
|
||||||
|
|
||||||
// Enter invite code first
|
// Enter invite code first
|
||||||
await page.fill('input#inviteCode', inviteCode);
|
await page.fill('input#inviteCode', inviteCode);
|
||||||
await page.click('button[type="submit"]');
|
|
||||||
|
// Click and wait for invite check API to complete
|
||||||
|
await Promise.all([
|
||||||
|
page.waitForResponse((resp) => resp.url().includes("/check") && resp.status() === 200),
|
||||||
|
page.click('button[type="submit"]'),
|
||||||
|
]);
|
||||||
|
|
||||||
// Wait for registration form
|
// Wait for registration form
|
||||||
await expect(page.locator("h1")).toHaveText("Create account");
|
await expect(page.locator("h1")).toHaveText("Create account");
|
||||||
|
|
|
||||||
4
frontend/test-results/.last-run.json
Normal file
4
frontend/test-results/.last-run.json
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"status": "passed",
|
||||||
|
"failedTests": []
|
||||||
|
}
|
||||||
|
|
@ -1,35 +0,0 @@
|
||||||
# Page snapshot
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
- generic [active] [ref=e1]:
|
|
||||||
- main [ref=e2]:
|
|
||||||
- generic [ref=e4]:
|
|
||||||
- generic [ref=e5]:
|
|
||||||
- heading "Welcome back" [level=1] [ref=e6]
|
|
||||||
- paragraph [ref=e7]: Sign in to your account
|
|
||||||
- generic [ref=e8]:
|
|
||||||
- generic [ref=e9]: Failed to fetch
|
|
||||||
- generic [ref=e10]:
|
|
||||||
- generic [ref=e11]: Email
|
|
||||||
- textbox "Email" [ref=e12]:
|
|
||||||
- /placeholder: you@example.com
|
|
||||||
- text: admin@example.com
|
|
||||||
- generic [ref=e13]:
|
|
||||||
- generic [ref=e14]: Password
|
|
||||||
- textbox "Password" [ref=e15]:
|
|
||||||
- /placeholder: ••••••••
|
|
||||||
- text: admin123
|
|
||||||
- button "Sign in" [ref=e16] [cursor=pointer]
|
|
||||||
- paragraph [ref=e17]:
|
|
||||||
- text: Don't have an account?
|
|
||||||
- link "Sign up" [ref=e18] [cursor=pointer]:
|
|
||||||
- /url: /signup
|
|
||||||
- status [ref=e19]:
|
|
||||||
- generic [ref=e20]:
|
|
||||||
- img [ref=e22]
|
|
||||||
- generic [ref=e24]:
|
|
||||||
- text: Static route
|
|
||||||
- button "Hide static indicator" [ref=e25] [cursor=pointer]:
|
|
||||||
- img [ref=e26]
|
|
||||||
- alert [ref=e29]
|
|
||||||
```
|
|
||||||
|
|
@ -1,35 +0,0 @@
|
||||||
# Page snapshot
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
- generic [active] [ref=e1]:
|
|
||||||
- main [ref=e2]:
|
|
||||||
- generic [ref=e4]:
|
|
||||||
- generic [ref=e5]:
|
|
||||||
- heading "Welcome back" [level=1] [ref=e6]
|
|
||||||
- paragraph [ref=e7]: Sign in to your account
|
|
||||||
- generic [ref=e8]:
|
|
||||||
- generic [ref=e9]: Failed to fetch
|
|
||||||
- generic [ref=e10]:
|
|
||||||
- generic [ref=e11]: Email
|
|
||||||
- textbox "Email" [ref=e12]:
|
|
||||||
- /placeholder: you@example.com
|
|
||||||
- text: admin@example.com
|
|
||||||
- generic [ref=e13]:
|
|
||||||
- generic [ref=e14]: Password
|
|
||||||
- textbox "Password" [ref=e15]:
|
|
||||||
- /placeholder: ••••••••
|
|
||||||
- text: admin123
|
|
||||||
- button "Sign in" [ref=e16] [cursor=pointer]
|
|
||||||
- paragraph [ref=e17]:
|
|
||||||
- text: Don't have an account?
|
|
||||||
- link "Sign up" [ref=e18] [cursor=pointer]:
|
|
||||||
- /url: /signup
|
|
||||||
- status [ref=e19]:
|
|
||||||
- generic [ref=e20]:
|
|
||||||
- img [ref=e22]
|
|
||||||
- generic [ref=e24]:
|
|
||||||
- text: Static route
|
|
||||||
- button "Hide static indicator" [ref=e25] [cursor=pointer]:
|
|
||||||
- img [ref=e26]
|
|
||||||
- alert [ref=e29]
|
|
||||||
```
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue