[REF] tests: remove chart snapshot tests #7313
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
There were a dozen chart snapshot tests in
chart_plugin.test.ts
. Some tests were relying exclusively on snapshots.The main issue is that snapshots don't actually test a feature. Reading the test provides no insight on what is actually tested, and after years of snapshot updates, who's to say that the relevant part of the snapshot hasn't changed ? Or that the 400 lines of snapshot for a new test were ever fully reviewed ?
Snapshots shouldn't be the main way a feature is tested. This commit removes most snapshot tests, and replaces them with more explicit
expect
matchers.Some snapshots were kept because a snapshot test is still useful as an alarm bell for the coder/reviewer (eg. "why has this pie bar fix changed snapshots of bar charts ?"). But having a dozen snapshot is pointless, making it more likely that the changes are never reviewed.
Task: 5160031
review checklist