Skip to content

Commit

Permalink
docs(contributors): add ADR 018 (#3922)
Browse files Browse the repository at this point in the history
Co-authored-by: Josh Black <joshblack@users.noreply.github.com>
  • Loading branch information
joshblack and joshblack authored Nov 14, 2023
1 parent 6b0c118 commit 9d1401b
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
3 changes: 3 additions & 0 deletions contributor-docs/adrs/adr-009-interaction-tests.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# ADR 009: Use Interaction testing in storybook to maintain components

> **Warning**
> This ADR is superceded by [`ADR 018`](./adr-018-interaction-tests-revisited.md)
## Status

| Stage | Status |
Expand Down
36 changes: 36 additions & 0 deletions contributor-docs/adrs/adr-018-interaction-tests-revisited.md
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.

0 comments on commit 9d1401b

Please sign in to comment.