Skip to content

test(desktop): fix inline code/math shortcut tests failing on develop after #4611 - #4624

Merged
Jocs merged 1 commit into
marktext:developfrom
FurkaanBoraa:fix/format-menu-shortcut-tests
Jun 21, 2026
Merged

Jocs merged 1 commit into
marktext:developfrom
FurkaanBoraa:fix/format-menu-shortcut-tests

Conversation

@FurkaanBoraa

Copy link
Copy Markdown
Contributor

Summary

The Test / test CI job currently fails on develop (and therefore on every open PR). The two failing cases are the inline-code / inline-math "DIVERGES" characterization tests in test/unit/specs/format-menu-state.spec.ts.

They were pinning a known bug where the muya inline-format toolbar advertised Ctrl+E / Shift+Ctrl+E for inline code / inline math even though no platform bound those keys. #4611 fixed that bug — the toolbar now shows the real defaults (Ctrl+\`` for inline code, Shift+Ctrl+M` for inline math) — but the tests weren't updated, so they still assert the old values and fail.

This updates the tests to the corrected behavior:

Values were read from source, not guessed: toolbar packages/muya/src/ui/inlineFormatToolbar/config.ts, keybindings keybindingsWindows.ts / keybindingsLinux.ts.

Type of change

  • Bug fix (non-breaking, fixes failing tests on develop)
  • New feature
  • Breaking change
  • Documentation update

Test plan

  • Manually tested on: macOS

pnpm run test:unit — full desktop unit suite green (642 tests; the 2 previously-failing cases now pass). pnpm run lint and pnpm run typecheck pass.

Notes for reviewers [optional]

Pure test change, no production code touched. Related: #4611.


By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.

…4611

marktext#4611 corrected the inline format toolbar labels to match the real
keybindings (inline code Ctrl+`, inline math Shift+Ctrl+M), but the
characterization tests in format-menu-state.spec.ts still asserted the
old, buggy Ctrl+E / Shift+Ctrl+E toolbar values, so they fail on develop.

Bring the tests in line with the corrected behavior:
- inline_math now agrees with the Format menu on Windows and Linux, so it
  moves into the reconcilable (matches) set.
- inline_code now matches on Windows (Ctrl+`); Linux intentionally binds
  Ctrl+Y, so the remaining Linux-only divergence is what the test pins.
@Jocs
Jocs merged commit 4d2816b into marktext:develop Jun 21, 2026
10 checks passed
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