odoo/o-spreadsheet#8841
Created by BI, Adrien Minne (adrm)
- label
- odoo:master-jest-custom-matchers-tests-adrm
- head
- 98328ee5fcf00687bcd5487cb6eafea5ccf43a29
| odoo/o-spreadsheet | |
|---|---|
| master | #8841 missing statuses missing r+ |
[IMP] tests: add tests for custom jest matchers
Description:
[IMP] tests: add tests for custom jest matchers
We define custom jest matcher (eg. expect(color).toBeSameColorAs(otherColor))
but never actually test that those work correctly. They, in fact, did not.
- most of the matchers had wrong error message when used with
expect().not expect().not.toExportdidn't work correctly (but was never used)
Most of the error message tests are written with snapshots, because
we use jest helpers to color/prettify the output, and testing those
is a pain.
[REF] tests: remove custom toBeCloseTo matcher
We re-defined the standard toBeCloseTo matcher in order to use it
in expect(...).toMatchObject({ x: expect.toBeCloseTo(...)}). But
we can just use expect.closeTo(1000) instead.
Task: 6272392
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