Open
Conversation
Collaborator
16071e5 to
6975752
Compare
pro-odoo
reviewed
Mar 24, 2026
Collaborator
LucasLefevre
left a comment
There was a problem hiding this comment.
A few other things are worth mentioning IMO:
- tests should be minimal
- tests should not be coupled to implementation details
|
|
||
| ### Use helpers rather than manual command dispatch | ||
|
|
||
| Rather than calling `model.dispatch("UPDATE_CELL", {...})` use the helpers functions inside `commands_helpers.ts`. And if there are no helper for the command you need to dispatch, create one ! It's easier to read in the test, and in the future if (when) the command is changed, only this helper will need to be modified. |
Collaborator
There was a problem hiding this comment.
Suggested change
| Rather than calling `model.dispatch("UPDATE_CELL", {...})` use the helpers functions inside `commands_helpers.ts`. And if there are no helper for the command you need to dispatch, create one ! It's easier to read in the test, and in the future if (when) the command is changed, only this helper will need to be modified. | |
| Rather than calling `model.dispatch("UPDATE_CELL", {...})` use the helpers functions inside `commands_helpers.ts`. And if there are no helper for the command you need to dispatch, create one ! It's easier to read in the test. It also decouples the test from the implementation: in the future if (when) the command changes, only this helper needs to be modified. |
|
|
||
| ### Use custom Jest matchers | ||
|
|
||
| We define custom jest matchers in `jest_extend.ts`, use them ! |
Collaborator
There was a problem hiding this comment.
standard English typography do not have a space there
Suggested change
| We define custom jest matchers in `jest_extend.ts`, use them ! | |
| We define custom jest matchers in `jest_extend.ts`, use them! |
6975752 to
24ca163
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Task: 0
review checklist