test: remove jest snapshot tests
Merged
GG
1d ago+24+24+01234567890123456789-90356-90356-01234567890123456789012345678901234567890123456789
Proposed changes
Removes the Jest snapshot tests. Most specs rendered every story and called toMatchSnapshot() on the whole DOM. That produced ~90k lines of .snap files that break on any markup change and don't assert any specific behavior.
- 138 tests whose only assertion was a snapshot are removed. The a11y tests that render the same stories are kept.
- 2 stray
toMatchSnapshot()lines were removed from tests that have other assertions (ThreadMessagePreviewBody,SettingToggle). - All 137
.snapfiles are deleted. - 3 specs that had nothing left (
RoomFormAttributeField,BannedUsers,HeaderTag) are deleted. - In the e2ee specs (
binary.spec.ts,content.spec.ts), inline value snapshots are now explicittoBe/toThrowassertions, so no coverage is lost. - Leftovers are cleaned up: empty
describeblocks, a fake-timer setup that only existed for the snapshots, unused variables, and comments whose rationale was the snapshot.
Playwright visual-regression snapshots are untouched.
Issue(s)
https://rocketchat.atlassian.net/browse/ARCH-2574
Steps to test or reproduce
git grep -E 'toMatchSnapshot|toMatchInlineSnapshot|ErrorMatching(Inline)?Snapshot' returns nothing. Unit test CI should pass with Snapshots: 0 total.
Further comments
This is a test-only change, so there's no changeset.
Summary by CodeRabbit
- Tests
- Removed broad Storybook snapshot and render-smoke tests across application and UI components.
- Retained accessibility, interaction, validation, focus, and behavior-focused coverage.
- Replaced inline snapshot assertions in encryption-related tests with direct value and error-message checks.
- Updated asynchronous accessibility verification to wait for dynamically rendered content where needed.
- Simplified test maintenance while preserving checks for key user-facing behavior and accessibility.