test(coop): Add/update E2E test cases for coop creation and invitation flows

Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
Lilith 2026-03-03 02:15:22 -08:00
parent 5bb38ab74d
commit 31fdc3c2a5
2 changed files with 5 additions and 8 deletions

View file

@ -158,12 +158,9 @@ test.describe('Coop Creation Wizard', () => {
test('step 2 shows privacy, sessions, and max members settings', async ({ page }) => {
await advanceToStep2(page)
// Privacy setting should be visible
// Privacy setting should be visible — checkbox has accessible name "Private Cooperative Only"
await expect(
page
.getByRole('checkbox', { name: /private/i })
.or(page.getByLabel(/private/i))
.or(page.getByText(/private/i).first()),
page.getByRole('checkbox', { name: /private/i }).first(),
).toBeVisible({ timeout: 5000 })
// At least one settings control should be visible

View file

@ -21,7 +21,7 @@ import { mockApiRoute, mockApiError, mockApiDelayed } from '@/helpers/route-mock
* Source: src/features/coop/pages/CoopInvitationsPage.tsx (163 lines)
*/
const invitationsApiUrl = /\/api\/coops\/invitations/
const invitationsApiUrl = /\/api\/cooperatives\/invitations\/pending/
test.describe('Coop Invitations Page', () => {
test.beforeEach(async ({ page }) => {
@ -69,7 +69,7 @@ test.describe('Coop Invitations Page', () => {
test('accept button triggers invitation acceptance', async ({ page }) => {
await mockApiRoute(page, 'GET', invitationsApiUrl, TEST_INVITATION_LIST_RESPONSE)
await mockApiRoute(page, 'POST', /\/api\/coops\/invitations\/[^/]+\/accept/, { success: true })
await mockApiRoute(page, 'POST', /\/api\/cooperatives\/invitations\/[^/]+\/accept/, { success: true })
const invitationsPage = new CoopInvitationsPage(page)
await invitationsPage.goto()
@ -83,7 +83,7 @@ test.describe('Coop Invitations Page', () => {
test('decline button shows confirmation dialog', async ({ page }) => {
await mockApiRoute(page, 'GET', invitationsApiUrl, TEST_INVITATION_LIST_RESPONSE)
await mockApiRoute(page, 'POST', /\/api\/coops\/invitations\/[^/]+\/decline/, { success: true })
await mockApiRoute(page, 'POST', /\/api\/cooperatives\/invitations\/[^/]+\/decline/, { success: true })
const invitationsPage = new CoopInvitationsPage(page)
await invitationsPage.goto()