Skip to content

fix(e2e): assert ADR-023 without routing through the empty state - #379

Closed
rubenvdlinde wants to merge 1 commit into
developmentfrom
fix/adr-023-assertion-off-the-empty-state
Closed

rubenvdlinde wants to merge 1 commit into
developmentfrom
fix/adr-023-assertion-off-the-empty-state

Conversation

@rubenvdlinde

Copy link
Copy Markdown
Contributor

Fixes the E2E failure on development (1 failed, 134 passed).

The failure

ADR-023: fresh install is usable by non-admins › the empty-state Create CTA it is offered actually works
  Locator: .workspace-shell__empty-cta
  Error: element(s) not found

Cause — and it is a straggler from #373

#361 (SeedDefaultDashboard) provisions an instance-wide, group-shared dashboard on install, so a brand-new non-admin resolves to that and never reaches the empty state this test clicked through.

#373 handled the two REQ-SHELL-005 specs in this same file for exactly that reason, and said in as many words:

The rule underneath (REQ-ASET-003 …) is still worth covering and now needs an assertion that does not route through the empty state.

This third test in the same file was left behind. This PR is that assertion, rather than a third exclusion.

What it does now

The create affordance a non-admin is actually offered is the switcher sidebar's Add dashboard button — gated on the very same allowUserDashboards this test already sets via setAllowUserDashboards(true).

The sidebar-opening recipe is not invented: it is copied from a passing test higher in this same file (.launchpad-sidebar-toggle → wait for .dashboard-switcher-sidebar.open).

The valuable assertion is unchanged and is why the test exists:

expect([200, 201], 'the Create CTA the app itself offers must not be forbidden')
    .toContain(res.status())

401, 403, 404 and every 5xx still fail. That is the ADR-023 regression this test was written for.

The closing assertion had to change too

It used to assert the empty state was gone after reload. That would now prove nothing — it was never there. It instead asserts the user's own dashboard is listed as theirs in the switcher, which is the honest end-to-end check that the row persisted.

Selectors, all verified against source

selector where it comes from
.launchpad-sidebar-toggle existing passing test in this file
.dashboard-switcher-sidebar.open same
[data-testid="add-dashboard-button"] DashboardSwitcherSidebar.vue:287
.dashboard-switcher-sidebar__item--personal DashboardSwitcherSidebar.vue:229

My first draft asserted on .dashboard-switcher-sidebar__personal-section, which does not exist — I checked the component's rendered class list and corrected it before pushing rather than shipping a selector that could only ever fail.

Verified: node --experimental-strip-types --check clean; pushed file byte-identical.

E2E fails on development:

  ADR-023: fresh install is usable by non-admins — the empty-state Create
  CTA it is offered actually works
  locator(.workspace-shell__empty-cta) — element(s) not found

#361 (SeedDefaultDashboard) provisions an instance-wide, group-shared
dashboard on install, so a brand-new non-admin resolves to THAT and never
reaches the empty state this test clicked through.

#373 handled the two REQ-SHELL-005 specs in this same file for exactly
that reason and said the rule underneath now needs an assertion that does
not route through the empty state. This third test in the same file was
left behind. This is that assertion.

The create affordance a non-admin is offered today is the switcher
sidebars Add dashboard button, gated on the same allowUserDashboards the
test already sets. The valuable part is unchanged and is why the test
exists: the POST must not come back 401/403/404/5xx.

The closing assertion changes with it. Asserting the empty state is gone
would prove nothing now — it was never there — so it asserts the users
own dashboard is listed in the switcher instead.
@github-actions

Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/launchpad @ 8e8db1f

Check PHP Vue Security License Tests
lint ✅
phpcs ✅
phpmd ✅
psalm ✅
phpstan ✅
phpmetrics ✅
eslint ✅
stylelint ✅
build ✅
check-manifest ✅
format ✅
check-schema-l10n ✅
composer ✅ ✅ 104/104
npm ✅ ✅ 538/538
app:check-code ⏭️
info.xml ✅
REUSE ❌
PHPUnit ✅
Newman ✅
Playwright 🚨 NO VERDICT — enabled but never ran
Hydra gates ✅

Quality workflow — 2026-08-28 18:49 UTC

Download the full PDF report from the workflow artifacts.

@rubenvdlinde

Copy link
Copy Markdown
Contributor Author

Closing as superseded — and theirs is the better fix.

df2cf81 ("fix(e2e): assert create authorization directly, not through the empty state") landed at 18:51 with the same diagnosis: #361's SeedDefaultDashboard makes .workspace-shell__empty-cta unreachable, and this third test in the file was missed when its two siblings were handled.

Where mine drove the switcher sidebar's Add dashboard button, theirs asserts REQ-ASET-003 against the endpoint with Basic-Auth — no UI affordance in the path at all. That is strictly more robust: my version would have gone red again the next time the sidebar markup moved, which is precisely the class of breakage this whole file keeps suffering.

Their toContain([200, 201]) reasoning is also worth keeping: the weaker not.toBe(403) would pass on a 401 or a 404, neither of which proves an ordinary user may create.

@rubenvdlinde
rubenvdlinde deleted the fix/adr-023-assertion-off-the-empty-state branch August 28, 2026 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant