dasch-swiss / sipi

Simple Image Presentation Interface
https://sipi.io
GNU Affero General Public License v3.0
32 stars 8 forks source link

test: add approval test setup #415

Closed subotic closed 6 months ago

subotic commented 7 months ago

related to DEV-3400

Problem Statement

There is a need for refactoring, so that future additions and bugfixes can be applied in a timely manner. The fear is, that although the code will be "only" refactored, that this might break the behavior in unforeseen ways.

Desired Outcome

Have a safety net in place, so that refactoring can be done without fear.

Solution

Add approval tests. Approval tests are a technique to write test, where the output of a action is persisted to disks and subsequent calls are compared to the version stored on disk. Another name is snapshot tests. This technique is usually applied to legacy codebases, where there is not a good unit test coverage and where to add good unit tests, the code needs to be first refactored to make it testable.

linear[bot] commented 7 months ago

DEV-3400 Setup and add approval tests