Skip to content

test(runner): pin the owner filter's case-folding at both seams (DEV-2519) - #254

Open
danielzytohoc wants to merge 1 commit into
masterfrom
test/DEV-2519-owner-filter-gaps
Open

test(runner): pin the owner filter's case-folding at both seams (DEV-2519)#254
danielzytohoc wants to merge 1 commit into
masterfrom
test/DEV-2519-owner-filter-gaps

Conversation

@danielzytohoc

@danielzytohoc danielzytohoc commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Hardening follow-up to the DEV-2519 owner filter (task). The feature's suites are green and cover every bullet in the ticket, but audited against docs/TESTING.md ("a test must fail when the control goes away"), two deliberate behaviors had no such test. Both sit on the two-writer created_by casing split (DEV-2501).

Unit — ownerOptions folds two casings into one owner. Every existing fixture is lowercase, so a refactor that keys options on the raw local part (same person listed twice, counts split) passed all 9 tests. Verified by applying exactly that mutation: only the new test catches it.

E2E — a pasted ?owner=SOMEONE.ELSE link. filterByOwner normalises its argument, so dropping the .toLowerCase() from the URL seed in MyDemos.tsx keeps every test green while the grid filters under an "Everyone" label — a lying picker on the exact artefact the ticket calls shareable. The new spec asserts the cards and the label; against that mutation it fails on the label, for the right reason.

Test-only change (+28 lines); both files already run in the CI globs (pipeline/*.test.mjs, unfiltered playwright test). Fresh local runs: unit 10/10, all-demos.spec.ts 12/12.


Note

Low Risk
Test-only additions; no production behavior or security-sensitive code is changed.

Overview
Adds two tests so the All Demos owner filter cannot silently drop case-folding around mixed created_by casings (browser vs MCP).

A unit test asserts ownerOptions merges two casings of the same address into one option with a combined count. An e2e spec loads ?owner=SOMEONE.ELSE and checks both the filtered cards and that the picker still labels the person, not Everyone.

Reviewed by Cursor Bugbot for commit a07a4d1. Bugbot is set up for automated code reviews on this repo. Configure here.

…2519)

The DEV-2519 suites were green but two deliberate behaviors had no test
that fails when they go away (docs/TESTING.md bar), both on the two-writer
created_by casing split (DEV-2501):

- ownerOptions folding two casings into one option: every unit fixture was
  lowercase, so keying options on the raw local part — same person twice,
  counts split — passed all 9 tests. Verified by that exact mutation: only
  the new test catches it.
- the URL seed's toLowerCase in MyDemos (a pasted ?owner=SOMEONE.ELSE link):
  removing it kept every test green while the grid filtered under an
  "Everyone" label. The new e2e asserts the cards AND the picker label;
  against that mutation it fails on the label, for the right reason.

Test-only change; both files run in the existing CI globs.
@danielzytohoc
danielzytohoc requested a review from demtario August 21, 2026 10:43
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.

2 participants