test(e2e): retarget FAB and event-menu selectors at the current UI (#39) #61
No reviewers
Labels
No labels
bug
discussion
enhancement
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
edufeed/edufeed-app!61
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/issue-39-e2e-selectors"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #39.
Six e2e files hard-coded the daisyUI speed-dial markup and all six broke together when
GlobalFABreplaced it. Routed through three shared helpers infixtures.js—FAB_TRIGGER,openCreateHub(),clickCreateAction()— so the next redesign touches one place instead of six.Two of the four bullets needed a semantic change, not a selector swap
button[data-tip="Create Event"]was wrong twice over.data-tipnow carries the action description, not its label — and it is absent entirely for actions with no description, which includes poll and learning-content. So that selector matched nothing and could not be repaired by renaming the value. Tiles are keyed onaria-label(the action'sariaLabelincreate-actions.js):.fab [role="button"]button[aria-label="Open actions menu"]button[data-tip="Create Event"]button[aria-label="Create new event"]button[data-tip="Create Learning Content"]button[aria-label="Share learning content"].fab button[data-tip="Create poll"]button[aria-label="Create poll"]Note the create-hub sheet carries the same
aria-labelas the trigger on adiv[role="menu"], so thebuttonqualifier is load-bearing.edit button hidden for non-ownerasserted the wrong element. It checked that the trigger was invisible.EventContextMenurenders for everyone, because it also carries Copy link / Copy event ID — only the author actions are conditional. Swapping the selector alone would have made this test fail on a correct build. The assertion moved to the Edit item, plus a positive control that the menu did open, so a count of 0 means "no Edit item" rather than "no menu".The event menu was orphaned, not renamed
The detail page routes through
CalendarEventDetailView→DetailHeader→EventContextMenu, triggeraria-label="Event menu".EventManagementActions("Manage event") still exists — but only insideCalendarEventDetailsModal, which the detail page never mounts.Item labels changed too:
EventContextMenuusesm.common_edit()/m.common_delete()— 'Edit' and 'Delete', not the old 'Delete Event'. The confirmation dialog still reads 'Delete Event?' (event_management_delete_confirm_title), so that assertion stays. Items are now matched by label instead of.first(), which would silently click "Share to communities" for a non-owner.layout-consistency could not be selector-swapped either
That test asserted the FAB sat in a
sticky bottom-0 h-0 mt-autowrapper inside<main>.GlobalFABis mounted at the layout root (+layout.svelte:379, outside<main>) and positionedfixed, somain .faband the wrapper-geometry assertions were both unreachable.Rewritten around the property the regression was actually about — on a page too short to scroll, the button is still at the bottom of the screen — plus explicit checks that it is outside
<main>and viewport-fixed.Related finding, deliberately not changed here: that sticky
mt-auto h-0wrapper still exists in+layout.svelte:369, but its only remaining child isScrollToTopButton, which is itselfposition: fixed. So the wholemt-auto/sticky mechanism now has no observable effect. Removing it is a source change outside this issue's scope — worth a separate decision.Also corrected
Two comments documenting removed behaviour (poll-flow's viewport rationale — the 9-button column that clipped no longer exists, the hub is a scrollable
max-h-[80vh]sheet; andMainContentArea's claim that GlobalFAB is anchored to<main>), and theCOVERAGE.mdrow describing the olddata-tipassertion.Verification
At
2d94d16b: all 316 tests across 38 e2e files parse and register underplaywright test --list(imports resolve, renamed test present), unit suite 5153/5153 across 468 files,pnpm lintclean.The browser run against the Docker relay stack is not done — that is TestOER's pass, per the testing split. A parse check proves the selectors are syntactically reachable, not that they match live DOM.
🤖 Generated with Claude Code
Six e2e files hard-coded the daisyUI speed-dial markup and all six broke together when GlobalFAB replaced it. Routed through three shared helpers in fixtures.js — FAB_TRIGGER, openCreateHub(), clickCreateAction() — so the next redesign touches one place instead of six. Two of the issue's four bullets needed a semantic change rather than a selector swap: - `button[data-tip="Create Event"]` was wrong twice over. `data-tip` now carries the action *description*, not its label, and is absent entirely for actions with no description — so the poll and learning-content tiles have no `data-tip` at all. Tiles are keyed on `aria-label` (the action's `ariaLabel` in create-actions.js): 'Create new event', 'Share learning content', 'Create poll'. - "edit button hidden for non-owner" asserted the *trigger* was invisible. EventContextMenu renders for everyone, because it also carries Copy link / Copy event ID; only the author actions are conditional. Swapping the selector alone would have failed on a correct build. The assertion moved to the Edit item, with a positive control that the menu did open — so a count of 0 means "no Edit item", not "no menu". The event menu itself: the detail page routes through CalendarEventDetailView -> DetailHeader -> EventContextMenu, whose trigger is `aria-label="Event menu"`. EventManagementActions ("Manage event") still exists but only inside CalendarEventDetailsModal, which the detail page never mounts — so the old selector was not renamed, it was orphaned. The item labels changed too: EventContextMenu uses m.common_edit()/m.common_delete() ('Edit'/'Delete'), not the old 'Delete Event'. The confirmation dialog still reads 'Delete Event?'. Items are now matched by label instead of `.first()`, which would silently click "Share to communities" for a non-owner. layout-consistency's FAB test could not be fixed by selector swap either: it asserted the FAB sat in a `sticky bottom-0 h-0 mt-auto` wrapper inside <main>. GlobalFAB is mounted at the layout root, outside <main>, and positioned `fixed`, so both `main .fab` and the wrapper-geometry assertions were unreachable. Rewritten around the property the regression was actually about — on a page too short to scroll, the button is still at the bottom of the screen — plus explicit checks that it is outside <main> and viewport-fixed. Also corrected two comments that documented removed behaviour (poll-flow's viewport rationale, MainContentArea's claim that GlobalFAB is anchored to <main>) and the COVERAGE.md row describing the old data-tip assertion. Verified: all 316 tests across 38 e2e files parse and register with `playwright test --list`, unit suite 5153/5153 (468 files), lint clean. The browser run against the Docker relay stack is TestOER's pass. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>