Skip to content

Commit

Permalink
Edits for concision
Browse files Browse the repository at this point in the history
  • Loading branch information
deandre committed Jan 10, 2025
1 parent 2bb0156 commit 93cf4df
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions src/content/troubleshooting/faq/why-tests-show-as-new.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ section: "uiTestsAndReview"

# Why do tests show as new in builds?

Tests are identified by their **story name**, which is a combination of key elements in the test file. If any of these elements change, the test will be considered new. Here's a breakdown of how story names are constructed and why they might change:
Tests are identified by their **story name**, which is a combination of key elements in the test file. If any of these elements change, the test will be considered new. Here's a breakdown of how story names are constructed and why they might change.

## Story Name Construction

Expand All @@ -17,6 +17,8 @@ The story name is generated from:
2. **Describe Block**: The names of `describe` blocks that organize and group related tests.
3. **It Block**: The name of the specific test within the `it` block.

If **any** of these elements change—file name, `describe` block name, or `it` block name—the story name changes. As a result, Chromatic interprets the test as new because it no longer matches the previously known story name.

### Example

Consider the following test file structure:
Expand All @@ -28,16 +30,6 @@ Consider the following test file structure:
The story name for this test would be:
`spec.cy.ts > template spec > loads homepage`

## Why a Test Shows as New

If **any** of these elements change—file name, `describe` block name, or `it` block name—the story name changes. As a result, Chromatic interprets the test as new because it no longer matches the previously known story name.

### Examples of Changes:

1. Renaming the file from `spec.cy.ts` to `home.cy.ts`.
2. Updating the `describe` block from `template spec` to `homepage spec`.
3. Modifying the `it` block from `loads homepage` to `renders homepage`.

## How to Avoid Unintentional New Stories

To prevent tests from showing as new unintentionally:
Expand Down

0 comments on commit 93cf4df

Please sign in to comment.