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
There are now three places in packages/memtomem/src/memtomem/web/static/app.js that mutate tag-filter and trigger a re-search, and they keep accumulating subtle behavioural differences:
Site
File:line
Behaviour
Result-panel chip click
app.js:2413
Overwrites tag-filter, calls doSearch()
Inline tag remove (clears matching filter)
app.js:1885
Conditionally clears tag-filter if it equals the removed tag, calls doSearch()
Sets tag-filter only, calls doSearch() (early-returns on empty q)
Issue #672 / PR #749 fixed the dual-axis bug in _searchByTag purely by code review + manual checking — there is no automated guard against a future helper extraction re-coupling these paths or someone "fixing" _searchByTag to also set search-input again.
Why
The repo currently has zero JavaScript test infrastructure (no package.json, no *.test.js, no Playwright config). All Web UI verification is manual, which doesn't scale as the SPA grows.
Pick the lowest-overhead option that catches regressions in CI:
Playwright + tiny smoke spec (recommended): one spec per mutation site, asserting the correct fields are populated and doSearch() request shape. Adds a Node toolchain dependency but the model is well-understood and CI patterns exist (Playwright's GitHub Action). Runs against mm web started in a fixture.
jsdom + vitest: pure-JS, fast, no browser. Can exercise _searchByTag / chip handlers in isolation by injecting the DOM. Cheaper to run but requires shimming qs, api, STATE, etc. Better as a unit-test layer than an integration check.
Backend-driven assertion: extend existing pytest by hitting /api/search?q=...&tag_filter=... and asserting the param shape that the frontend should send. Catches API contract drift but not the actual click → request wiring.
Option 1 + Option 3 together would give the most coverage; Option 2 alone is probably enough for the tag-filter cluster.
Out of scope
Full SPA test coverage (this is a foothold, not a sweep).
Visual regression testing.
Performance / load testing of the search pipeline.
Acceptance
A new test directory (e.g. packages/memtomem/tests/web/) runs in CI.
What
There are now three places in
packages/memtomem/src/memtomem/web/static/app.jsthat mutatetag-filterand trigger a re-search, and they keep accumulating subtle behavioural differences:app.js:2413tag-filter, callsdoSearch()app.js:1885tag-filterif it equals the removed tag, callsdoSearch()_searchByTag)app.js:4059(post-#749)tag-filteronly, callsdoSearch()(early-returns on emptyq)Issue #672 / PR #749 fixed the dual-axis bug in
_searchByTagpurely by code review + manual checking — there is no automated guard against a future helper extraction re-coupling these paths or someone "fixing"_searchByTagto also setsearch-inputagain.Why
package.json, no*.test.js, no Playwright config). All Web UI verification is manual, which doesn't scale as the SPA grows.Suggested approach
Pick the lowest-overhead option that catches regressions in CI:
doSearch()request shape. Adds a Node toolchain dependency but the model is well-understood and CI patterns exist (Playwright's GitHub Action). Runs againstmm webstarted in a fixture._searchByTag/ chip handlers in isolation by injecting the DOM. Cheaper to run but requires shimmingqs,api,STATE, etc. Better as a unit-test layer than an integration check./api/search?q=...&tag_filter=...and asserting the param shape that the frontend should send. Catches API contract drift but not the actual click → request wiring.Option 1 + Option 3 together would give the most coverage; Option 2 alone is probably enough for the tag-filter cluster.
Out of scope
Acceptance
packages/memtomem/tests/web/) runs in CI.search-input.app.js:1885andapp.js:2413paths.References