Repository navigation
Description
Summary: The full frontend/tests/browser.rs wasm-bindgen-test
suite (headless-browser DOM tests) is never run by CI —
.github/workflows/wasm-tests.yml only runs -- --lib and
-- --test collab_e2e. Running the suite directly shows 127
passed / 21 failed, all 21 pre-existing at the merge-base, not
introduced by the syntax-highlighting branch. Because this suite
never runs in CI, it did not catch a real regression on this
branch until a manual full run was performed.
Severity: S2 — a real regression (two browser tests broken by
the highlighting DOM change) shipped past CI unnoticed; the test
suite exists but provides no actual safety net for a large class
of DOM-observable behavior (headings, lists, code blocks, paste).
Environment:
- Deploy: local (headless Firefox,
wasm-bindgen-test-runner) - Commit: branch head of
code-blocks-syntax-highlighting;
merge-base3546f0c - Browser: headless Firefox (headless Chrome crashed with SIGKILL
in this sandbox; not evaluated further)
Repro steps:
cd frontend- Run the full
browserintegration target under
wasm-pack test --headless --firefox -- --test browser
(or the CI-equivalent invocation used forcollab_e2e, swapped
to--test browser). - Observe the pass/fail summary.
Expected: All tests in frontend/tests/browser.rs pass, or —
if any are legitimately quarantined — they are marked #[ignore]
with a tracked reason, not silently absent from CI.
Observed: 127 passed / 21 failed. Checking out the merge-base
commit (3546f0c) and re-running reproduces the same 21 failures,
confirming they are pre-existing and unrelated to the highlighting
branch's changes — but nothing catches them today because the
target isn't in any CI workflow.
Breakdown of the 21:
- 15 bare-tag assertion failures — tests assert on raw HTML
tags (e.g.html.contains("<pre>")-style), but every block now
carries adata-block-idattribute stamped by
EditorState/Node::needs_block_idinfrontend/src/editor/model.rs,
which has been present since the initial public release
(ec2d37d). Example:renders_headingin
frontend/tests/browser.rs. - 6 clipboard-simulation harness-gap failures — tests
construct a syntheticClipboardEvent/DataTransferand dispatch
it, but headless Firefox does not read the synthetic data back
through the production paste path, which logs
"clipboard empty — nothing to paste"(see the
debug::warn("paste", ...)call infrontend/src/editor/view.rs).
Affected tests (by name, infrontend/tests/browser.rs):
paste_markdown_heading_creates_h1_in_dom,
paste_markdown_bullet_list_creates_ul_in_dom,
paste_pre_wrapped_markdown_with_text_plain_parses_as_markdown,
paste_pre_wrapped_markdown_without_text_plain_parses_as_markdown,
paste_pre_code_without_language_preserves_codeblock,
paste_real_code_block_preserves_codeblock.
Evidence:
- Full-suite run at branch head: 127 passed / 21 failed (headless
Firefox). - Same 21 failures reproduced at merge-base
3546f0c, confirming
pre-existing status. - Chrome headless: process SIGKILL'd in this sandbox environment;
not further diagnosed — may be sandbox-specific rather than a
browser-target bug.
Suggested approach:
- Fix the 15 bare-tag assertions to account for
data-block-id
(e.g. assert on tag + attribute presence rather than an exact
substring, or scope the substring check past the attribute). - Decide on a harness approach for the 6 paste tests — either get
the synthetic clipboard event readable in headless Firefox, or
explicitly#[ignore = "..."]them with a tracked follow-up
reason. - Add
--test browserto the wasm-pack invocation in
.github/workflows/wasm-tests.yml(alongside the existing
--liband--test collab_e2etargets) once (1) and (2) are
resolved, so the suite actually gates merges going forward.
Suspected area:
.github/workflows/wasm-tests.yml(CI wiring gap)frontend/src/editor/model.rs—Node::needs_block_id(source of
thedata-block-idstamping that the 15 assertions don't account
for)frontend/src/editor/view.rs— paste-empty-clipboard log pathfrontend/tests/browser.rs— the 21 affected test bodies
Activity
fix(mermaid): close the four remaining gallery minors (#16, #18, #20, #…