Skip to content

Commit

Permalink
doc: add ADR on removing snapshot tests (#658)
Browse files Browse the repository at this point in the history
* doc: add adr on removing snapshot tests
  • Loading branch information
chohner authored Mar 14, 2024
1 parent 9c3f794 commit 5f8c088
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 5 deletions.
33 changes: 33 additions & 0 deletions doc/adr/0002-remove-snapshot-tests.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# 1. Remove snapshot tests

Date: 2024-03-12

## Status

Accepted

## Context

Several team members believe that the efforts of keeping snapshot tests are not worth the effort.

There have been several external reasons to make a decision as to keep snapshot tests, such as the current tool [storyshots](https://storybook.js.org/addons/@storybook/addon-storyshots/) (storybook plugin) being [deprecated](https://github.com/storybookjs/storybook/issues/24657). With the recent [v8.0.0 release of storybook](https://github.com/storybookjs/storybook/releases/tag/v8.0.0), the plugin is now officially unsupported. The previous snapshot test setup was removed and marked as `todo`.

We consider to either fully remove snapshot tests altogether or follow the [migration guide](https://storybook.js.org/docs/writing-tests/storyshots-migration-guide) to move to the new [Storybook test runner](https://storybook.js.org/docs/writing-tests/test-runner).

## Decision

As a group we decided NOT to migrate to the new test configuration but instead REMOVE snapshot tests:

- Nobody gained additional confidence from snapshot tests
- Most felt updating snapshots to be an unneeded chore
- Some mentioned snapshot tests failing in unforeseen and hard-to-debug ways
- Some felt reducing dependencies and speeding up tests are helpful
- All agreed to instead commit to writing component / interaction tests

## Consequences

- The previous snapshot test implementation was already removed in the update to [storybook v8.0.0](https://github.com/digitalservicebund/a2j-rechtsantragstelle/commit/ad46328c199c890c1e0c6971f6994ee0267177b3) (commit `ad46328`), no action needed.

- With merging of this ADR, the test file containing the reminder will be removed.

- A ticket for adding component test already exists, the current priority on implementing them was noted there.
5 changes: 0 additions & 5 deletions tests/unit/components/storybook.test.ts

This file was deleted.

0 comments on commit 5f8c088

Please sign in to comment.