Skip to content

Conversation

hokolomopo
Copy link
Contributor

@hokolomopo hokolomopo commented Oct 10, 2025

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

  • feature is organized in plugin, or UI components
  • support of duplicate sheet (deep copy)
  • in model/core: ranges are Range object, and can be adapted (adaptRanges)
  • in model/UI: ranges are strings (to show the user)
  • undo-able commands (uses this.history.update)
  • multiuser-able commands (has inverse commands and transformations where needed)
  • new/updated/removed commands are documented
  • exportable in excel
  • translations (_t("qmsdf %s", abc))
  • unit tested
  • clean commented code
  • track breaking changes
  • doc is rebuild (npm run doc)
  • status is correct in Odoo

@robodoo
Copy link
Collaborator

robodoo commented Oct 10, 2025

Pull request status dashboard

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
@hokolomopo hokolomopo force-pushed the master-remove-chart-snapshot-adrm branch from 5ce19c9 to b1adcda Compare October 10, 2025 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants