You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Subtask of #1983. Organization FAQ (/organizations/[id]/faq) and organization resources (/organizations/[id]/resources) pages render <EmptyState> when embedded lists (faqEntries, resources on the organization payload from getOrganization) are empty, with different copy for admins (can add) vs non-editors. Event FAQ and resources already have dedicated empty-state E2E specs (#2073); the organization entity does not yet mirror that coverage and still relies on seed-dependent display branches in generic page specs.
This subtask adds Playwright specs that use page.route() to fulfill HTTP 200 on the public organization detail GET with an organization JSON body whose faqEntries and resources arrays are empty (or overridden to include items for the “not empty” case), then assert empty-state visibility, messaging/variant, and that the empty state is not shown when at least one item is present.
Scope
Pages:
Page
Empty condition
/organizations/[id]/faq
Organization has no FAQ entries
/organizations/[id]/resources
Organization has no resources
API to mock (align with the app):
GET organization by id via the public API base used by getOrganization (withoutAuth: true → /api/public/communities/organizations/:id or equivalent glob used in the Nuxt proxy). FAQ and resource lists for these subpages are read from the same organization detail payload (not separate list URLs), analogous to events and mock-public-event-detail.ts.
Permission branching:
Admin / can-edit: empty state visible with the variant that includes create/add affordances (per EmptyStatepermission prop)
Non-editor (viewer): empty state visible with the read-only variant (no misleading edit CTAs)
Test cases
For each page (FAQ and resources):
Empty list — After mocking empty faqEntries or resources on the organization detail response, data-testid="empty-state" (or page-object emptyState) is visible and the message matches expectations for that page type
Not empty — When the mocked payload includes at least one FAQ entry or resource (or default backend data is allowed), empty state is not shown and list/cards are visible
Detail mock setup — Add a small helper module (for example frontend/test-e2e/utils/mock-public-organization-detail.ts) patterned after mock-public-event-detail.ts: stable UUID constant for cold page.goto, routeMockPublicOrganizationDetail(page, orgId, body), and mockOrganizationDetailPayload(orgId, overrides) returning minimal JSON valid for mapOrganization (including required fields such as texts, location, socialLinks, status, and empty faqEntries / resources by default). Fulfill 200 + application/json before page.goto so client-only fetches see the mock.
Page objects — Prefer OrganizationFAQPage (~/test-e2e/page-objects/organization/faq/OrganizationFAQPage.ts) and organization resources locators from newOrganizationPage (~/test-e2e/page-objects/organization/OrganizationPage.ts), reusing emptyState / emptyStateMessage patterns from event specs.
Auth / roles — Use test.use({ storageState: ... }) or existing constants such as MEMBER_AUTH_STATE_PATH vs default admin storage, consistent with event-faq-empty-states.spec.ts and other entity permission specs.
Cleanup — await page.unrouteAll() in afterEach (or scoped route teardown) to avoid leaking mocks.
Tags — Use @desktop and @mobile to match sibling entity specs.
Contribution
Part of #1983 — E2E error and empty state coverage. Should follow the implementation and assertions established for events in #2073. Can be worked in parallel with organization group empty-state and form-validation subtasks. Parent audit context: #1959.
Terms
Description
Background
Subtask of #1983. Organization FAQ (
/organizations/[id]/faq) and organization resources (/organizations/[id]/resources) pages render<EmptyState>when embedded lists (faqEntries,resourceson the organization payload fromgetOrganization) are empty, with different copy for admins (can add) vs non-editors. Event FAQ and resources already have dedicated empty-state E2E specs (#2073); the organization entity does not yet mirror that coverage and still relies on seed-dependent display branches in generic page specs.This subtask adds Playwright specs that use
page.route()to fulfill HTTP 200 on the public organization detail GET with an organization JSON body whosefaqEntriesandresourcesarrays are empty (or overridden to include items for the “not empty” case), then assert empty-state visibility, messaging/variant, and that the empty state is not shown when at least one item is present.Scope
Pages:
/organizations/[id]/faq/organizations/[id]/resourcesAPI to mock (align with the app):
GETorganization by id via the public API base used bygetOrganization(withoutAuth: true→/api/public/communities/organizations/:idor equivalent glob used in the Nuxt proxy). FAQ and resource lists for these subpages are read from the same organization detail payload (not separate list URLs), analogous to events andmock-public-event-detail.ts.Permission branching:
EmptyStatepermissionprop)Test cases
For each page (FAQ and resources):
faqEntriesorresourceson the organization detail response,data-testid="empty-state"(or page-objectemptyState) is visible and the message matches expectations for that page typeEmptyStateprops)Spec file locations
Implementation notes
Detail mock setup — Add a small helper module (for example
frontend/test-e2e/utils/mock-public-organization-detail.ts) patterned aftermock-public-event-detail.ts: stable UUID constant for coldpage.goto,routeMockPublicOrganizationDetail(page, orgId, body), andmockOrganizationDetailPayload(orgId, overrides)returning minimal JSON valid formapOrganization(including required fields such astexts,location,socialLinks,status, and emptyfaqEntries/resourcesby default). Fulfill200+application/jsonbeforepage.gotoso client-only fetches see the mock.Page objects — Prefer
OrganizationFAQPage(~/test-e2e/page-objects/organization/faq/OrganizationFAQPage.ts) and organization resources locators fromnewOrganizationPage(~/test-e2e/page-objects/organization/OrganizationPage.ts), reusingemptyState/emptyStateMessagepatterns from event specs.Auth / roles — Use
test.use({ storageState: ... })or existing constants such asMEMBER_AUTH_STATE_PATHvs default admin storage, consistent withevent-faq-empty-states.spec.tsand other entity permission specs.Cleanup —
await page.unrouteAll()inafterEach(or scoped route teardown) to avoid leaking mocks.Tags — Use
@desktopand@mobileto match sibling entity specs.Contribution
Part of #1983 — E2E error and empty state coverage. Should follow the implementation and assertions established for events in #2073. Can be worked in parallel with organization group empty-state and form-validation subtasks. Parent audit context: #1959.