-
Notifications
You must be signed in to change notification settings - Fork 538
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(contributors): add ADR 018 (#3922)
Co-authored-by: Josh Black <joshblack@users.noreply.github.com>
- Loading branch information
Showing
2 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
contributor-docs/adrs/adr-018-interaction-tests-revisited.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# ADR 018: Interaction testing (revisited) | ||
|
||
## Status | ||
|
||
| Stage | Status | | ||
| -------- | ------ | | ||
| Approved | 🚧 | | ||
| Adopted | 🚧 | | ||
|
||
## Context | ||
|
||
> **Note** | ||
> This ADR supercedes [`ADR 009`](./adr-009-interaction-tests.md) | ||
We author tests using a combination of Jest and Playwright. Typically, Jest is | ||
used for unit and integration tests and Playwright is used for Visual Regression | ||
Tests against our Storybook. | ||
|
||
In `ADR 009`, we proposed using Storybook's [`play` | ||
functions](https://storybook.js.org/docs/react/writing-stories/play-function) as | ||
the recommended way to author tests that require tests based on user | ||
interactions. In this ADR, we would like to revisit this decision. | ||
|
||
## Decision | ||
|
||
For tests involving interaction, use Playwright to visit a storybook story and | ||
interact with the component directly. This will allow for easy integration with | ||
Visual Regression Testing and our automated accessibility testing (through axe). | ||
In order to perform interactions, use [actions from | ||
Playwright](https://playwright.dev/docs/input). | ||
|
||
### Impact | ||
|
||
The impact of this decision is minimal as we only have one example of | ||
interaction stories, `UnderlineNav.interactions.stories.tsx`, and it has | ||
corresponding tests in Playwright. |