Skip to content

Use the fake clock in the highlighted code block copy button test - #5895

Merged
Eugene (OEvgeny) merged 1 commit into
mainfrom
OEvgeny/dev-code-block-copy-fake-clock
Oct 18, 2026
Merged

Eugene (OEvgeny) merged 1 commit into
mainfrom
OEvgeny/dev-code-block-copy-fake-clock

Conversation

@OEvgeny

Copy link
Copy Markdown
Collaborator

Follow-up to #5892: behavior.highlighted.html waits 5 real seconds for "Copied" to go back to "Copy".

Changelog Entry

Not required, development only.

Description

As promised in #5892, the highlighted code block copy button test now uses the fake clock: it waits for the highlighted code, then advances the clock by 5 seconds instead of waiting in real time. This needed #5893's highlighter fix, merged now.

Specific Changes

  • __tests__/html2/markdown/codeBlockCopyButton/behavior.highlighted.html: fake clock, wait for pre.shiki, clock.tick(5_000) before asserting "Copy"

  • I have added tests and executed them locally

  • I have updated CHANGELOG.md

  • I have updated documentation

Review Checklist

This section is for contributors to review your work.

  • Accessibility reviewed (tab order, content readability, alt text, color contrast)
  • Browser and platform compatibilities reviewed
  • CSS styles reviewed (minimal rules, no z-index)
  • Documents reviewed (docs, samples, live demo)
  • Internationalization reviewed (strings, unit formatting)
  • package.json and package-lock.json reviewed
  • Security reviewed (no data URIs, check for nonce leak)
  • Tests reviewed (coverage, legitimacy)

…seconds

Waits for the Python code to be highlighted, then advances the clock by 5 seconds.
Needs #5893: without it, a code block with a language that is rendered before Shiki has loaded stays empty.
@OEvgeny
Eugene (OEvgeny) marked this pull request as ready for review October 18, 2026 17:58
Copilot AI balanced review requested due to automatic review settings October 18, 2026 17:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@OEvgeny
Eugene (OEvgeny) enabled auto-merge (squash) October 18, 2026 18:04
@OEvgeny
Eugene (OEvgeny) merged commit 06c6ada into main Oct 18, 2026
32 checks passed
@OEvgeny
Eugene (OEvgeny) deleted the OEvgeny/dev-code-block-copy-fake-clock branch October 18, 2026 20:27
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.

3 participants