Skip to content

frontend/tests/browser.rs wasm suite not wired into CI; 21 pre-existing failures masked #20

Closed

Description

@jjbaumert

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-base 3546f0c
  • Browser: headless Firefox (headless Chrome crashed with SIGKILL
    in this sandbox; not evaluated further)

Repro steps:

  1. cd frontend
  2. Run the full browser integration target under
    wasm-pack test --headless --firefox -- --test browser
    (or the CI-equivalent invocation used for collab_e2e, swapped
    to --test browser).
  3. 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 a data-block-id attribute stamped by
    EditorState/Node::needs_block_id in frontend/src/editor/model.rs,
    which has been present since the initial public release
    (ec2d37d). Example: renders_heading in
    frontend/tests/browser.rs.
  • 6 clipboard-simulation harness-gap failures — tests
    construct a synthetic ClipboardEvent/DataTransfer and 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 in frontend/src/editor/view.rs).
    Affected tests (by name, in frontend/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:

  1. 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).
  2. 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.
  3. Add --test browser to the wasm-pack invocation in
    .github/workflows/wasm-tests.yml (alongside the existing
    --lib and --test collab_e2e targets) 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
    the data-block-id stamping that the 15 assertions don't account
    for)
  • frontend/src/editor/view.rs — paste-empty-clipboard log path
  • frontend/tests/browser.rs — the 21 affected test bodies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions