Skip to content

Make the snapshots of recently added html2 tests easier to review - #5908

Merged
Eugene (OEvgeny) merged 10 commits into
mainfrom
OEvgeny/dev-readable-weekend-tests
Oct 20, 2026
Merged

Eugene (OEvgeny) merged 10 commits into
mainfrom
OEvgeny/dev-readable-weekend-tests

Conversation

@OEvgeny

@OEvgeny Eugene (OEvgeny) commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator

Make the snapshots of recently added html2 tests easier to review.

Changelog Entry

Not required, development only.

Description

Some recently added keyboard tests skipped snapshots between key presses, and some snapshots did not say what they show. Keyboard tests now snapshot every key press, each snapshot follows a // THEN: comment describing it, and the send box is hidden where it is not under test.

Specific Changes

  • carousel/flipperButton.focusVisible, richCard/heroCard.pushButton.focusVisible, richCard/animationCard.gif: snapshot the focused element before the next key, hide the send box

  • richCard/animationCard.gif.forcedColors (and .fluent): forced colors split out of animationCard.gif

  • suggestedActions/suggestedActions.flipperButton.focusVisible, transcript/navigation/visualKeyboardIndicator.styleOptions: one SHIFT-TAB per step, snapshot after each

  • richCard/receiptCard.textSpacing, richCard/mediaCard.mediaList, markdown/codeBlock/remount, markdown/codeBlock/contrast, activity/programmingLanguageTitle: // THEN: describes each snapshot, samples next to their assertions

  • carousel/navigation.arrowKeys*: snapshot after every key, assert the settled position; split formControls into cards, submitButton, heroCardButton (the input case asserts the caret after every key)

  • pageConditions.carouselSettled, testHelpers.isCardInView, testHelpers.isFlipperHidden: replace copies in the carousel tests

  • 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)

Eugene Olonov added 3 commits October 19, 2026 00:45
…ep and describe every snapshot

- Take a snapshot after every key press in keyboard focus tests, each preceded by a THEN comment
- Hide the send box where it is not under test
- Replace "Should match snapshot" with what the snapshot shows
- Keep test data next to the assertions that use it
@OEvgeny
Eugene (OEvgeny) marked this pull request as ready for review October 19, 2026 18:54
Copilot AI balanced review requested due to automatic review settings October 19, 2026 18:54

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 19, 2026 19:07
Comment thread __tests__/html2/carousel/navigation.arrowKeys.input.html
@@ -142,7 +150,7 @@
expect(matchMedia('(forced-colors: active)').matches).toBe(true);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nitpick: maybe we should split out another high contrast test than changing the contrast on-the-fly. For simpler test.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Moved forced colors into its own animationCard.gif.forcedColors.html (and .fluent) in bc2c2ae; the original test no longer switches contrast.

…weekend-tests

# Conflicts:
#	__tests__/html2/richCard/animationCard.gif.fluent.html.snap-4.png
#	__tests__/html2/richCard/animationCard.gif.html

Co-authored-by: OEvgeny <2841858+OEvgeny@users.noreply.github.com>
@OEvgeny
Eugene (OEvgeny) merged commit 506adb4 into main Oct 20, 2026
32 checks passed
@OEvgeny
Eugene (OEvgeny) deleted the OEvgeny/dev-readable-weekend-tests branch October 20, 2026 22:21
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.

4 participants