ghostguild-org/e2e/member-profile.spec.js
Jennie Robinson Faber bb0dbfe53e test(e2e): align specs with current page structure
join-flow:
- Form now requires Community Guidelines agreement; tests check the
  checkbox before expecting submit to enable.
- Contribution input is a numeric field with preset chip buttons, not a
  USelect with $0/mo options — fill the input directly.
- Success state lives in SignupFlowOverlay ("Welcome to Ghost Guild!");
  no .success-box exists. Match by heading instead.
- Inline .error-box renders OUTSIDE <form>, so duplicate-email assertion
  uses .signup-flow-overlay .error-box (which is the user-facing error).

member-profile:
- "How you appear to other members" copy was retired; replace with the
  stable "Show in Member Directory" structural label.
- Add waitForLoadState('networkidle') after goto for ClientOnly auth
  hydration so "Edit Profile" reliably appears within timeout.

board:
- Add waitForLoadState('networkidle') after goto so the action-bar's
  "+ New Post" click handler is bound before the test clicks.
- Submit button is named exactly "Post" — disambiguate from "+ New Post"
  buttons with { exact: true }.
- Delete is a two-step in-card confirm (Delete → Confirm), not a native
  browser dialog; drop the page.once('dialog') listener.

admin-board-channels:
- Channel name placeholder is "e.g., coop-formation" (no leading #).
- Slack Channel ID input only appears in the Edit modal (v-if="editingId"),
  not on Create — Slack channel is auto-created server-side. Drop the
  slack ID fill from the Create step.
- Add waitForLoadState('networkidle') before opening the modal.
2026-04-26 18:28:14 +01:00

58 lines
2.2 KiB
JavaScript

import { test, expect } from './helpers/fixtures.js'
test.describe('Member profile page', () => {
test('profile page loads', async ({ adminPage }) => {
await adminPage.goto('/member/profile')
await adminPage.waitForLoadState('networkidle')
// Auth is checked client-side in onMounted — wait for profile form to render
await expect(adminPage.getByText('Edit Profile')).toBeVisible({ timeout: 15000 })
// Verify a stable structural section label, not transient marketing copy
await expect(adminPage.getByText('Show in Member Directory')).toBeVisible()
})
test('form fields are present', async ({ adminPage }) => {
await adminPage.goto('/member/profile')
await expect(adminPage.getByText('Edit Profile')).toBeVisible({ timeout: 15000 })
// Name input
await expect(adminPage.locator('input[placeholder="Your name"]')).toBeVisible()
// Bio textarea
await expect(adminPage.locator('textarea[placeholder*="Share your background"]')).toBeVisible()
// Save button
await expect(adminPage.getByRole('button', { name: 'Save Profile' })).toBeVisible()
})
test('bio field accepts input', async ({ adminPage }) => {
await adminPage.goto('/member/profile')
await adminPage.waitForLoadState('networkidle')
await expect(adminPage.getByText('Edit Profile')).toBeVisible({ timeout: 15000 })
const bio = adminPage.locator('textarea[placeholder*="Share your background"]')
const saveBtn = adminPage.getByRole('button', { name: 'Save Profile' })
// Save button should start disabled (no changes yet)
await expect(saveBtn).toBeDisabled()
// Clear and type new text
await bio.clear()
await bio.fill('Game designer exploring cooperative structures')
// Save button should now be enabled
await expect(saveBtn).toBeEnabled()
})
test('pronouns field editable', async ({ adminPage }) => {
await adminPage.goto('/member/profile')
await expect(adminPage.getByText('Edit Profile')).toBeVisible({ timeout: 15000 })
const pronouns = adminPage.locator('input[placeholder="e.g., she/her, they/them"]')
await expect(pronouns).toBeVisible()
await pronouns.clear()
await pronouns.fill('they/them')
await expect(pronouns).toHaveValue('they/them')
})
})