Skip to content

Rewrite view tests using snapshots #45

@julen

Description

@julen

In #37 we had to remove view tests that checked the context being rendered because they were basically duplicating application code and their usefulness is rather questionable.

Instead of this, we will rather use snapshot testing: take a snapshot of the rendered/returned context and store it in a file, serialized. This human-readable output will be checked by developers for validity and it will be committed to version control. Test runs will read from the snapshot file and compare it to the output provided by the view being tested.

Changes in view contexts/payloads mean the snapshot files need to be reviewed and updated too.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions