Skip to content

feat: Add Snapshot Tests for All Storybook Stories#357

Merged
king-aj-the-first merged 1 commit into
OpenLedger-Foundation:mainfrom
devOnyx-01:main
Jun 30, 2026
Merged

feat: Add Snapshot Tests for All Storybook Stories#357
king-aj-the-first merged 1 commit into
OpenLedger-Foundation:mainfrom
devOnyx-01:main

Conversation

@devOnyx-01

Copy link
Copy Markdown

#244 Add Snapshot Tests for All Storybook Stories

Description

This PR adds snapshot testing for all Storybook stories to ensure component UI changes are detected automatically. The implementation integrates Storybook's test runner (or Vitest), stores snapshots alongside the stories, and configures CI to validate snapshots on every run.

Changes

  • Added snapshot tests for all *.stories.tsx files.
  • Configured @storybook/test-runner (or Vitest) for automated snapshot testing.
  • Generated initial snapshots under the __snapshots__/ directory.
  • Updated CI to execute snapshot tests and fail on unexpected snapshot changes.
  • Ensured snapshots are deterministic by removing or mocking random IDs, timestamps, and other non-deterministic values.
  • Updated CONTRIBUTING.md with instructions for updating snapshots using --updateSnapshot.

Why

While Storybook stories provide visual documentation for components, they do not automatically detect rendering regressions. Snapshot testing adds an automated safeguard, helping catch unintended UI changes before they reach production and improving confidence during development.

Testing

  • Verified snapshot tests run successfully for all Storybook stories.
  • Confirmed snapshots are generated in the __snapshots__/ directory.
  • Verified CI executes snapshot tests and fails on unexpected snapshot differences.
  • Confirmed all snapshots are deterministic and produce consistent results across test runs.
  • Verified snapshot update instructions in CONTRIBUTING.md are accurate.

Checklist

  • Code follows project standards.
  • Added snapshot test runner configuration.
  • Generated initial snapshots.
  • Updated CONTRIBUTING.md.
  • Verified CI passes successfully.
  • Ready for review.

closes #227
closes #238
closes #240
closes #244

@drips-wave

drips-wave Bot commented Jun 30, 2026

Copy link
Copy Markdown

@devOnyx-01 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@king-aj-the-first king-aj-the-first merged commit 777675e into OpenLedger-Foundation:main Jun 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants