vitest-dev / vitest-dev/vitest

Display Snapshot of the component in Vitest UI

Open
#4,060 0 comments 7 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feat: ui p2-nice-to-have
Dominant language
TypeScript
Stars
17.1k
Forks
2k
Avg merge
1d 22h
Merged PRs (30d)
94

Description

Clear and concise description of the problem

When I create a snapshot of the component in the test, I have to look for the file I try to figure out which is the component I want to see (When I make a few snapshots), because they are all in the same file. The style of the file doesn't let me check very well. Most of when the component is a form, I want to check if the fields are filled correctly.

Suggested solution

Maybe it could be a way to display the component snapshot in vitest-ui, to check the component snapshot in that place, so the users won't need to search the snapshot file and try to figure out the bad style of the component.

Display this in vitest UI I think will improve the development of the tests and it will be more efficient to check if everything is ok.

Alternative

No response

Additional context

No response

Validations

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the Vitest UI entry point for displaying test snapshots and the existing handling of component snapshots. Define how a component snapshot should be selected and rendered in the UI, then verify that users can distinguish and inspect multiple component snapshots without opening the snapshot file.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
testing
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.