Summary: | Cypress tests - mockData should not replace "_id" fields if passed | ||
---|---|---|---|
Product: | Koha | Reporter: | Jonathan Druart <jonathan.druart> |
Component: | Test Suite | Assignee: | Jonathan Druart <jonathan.druart> |
Status: | Signed Off --- | QA Contact: | Testopia <testopia> |
Severity: | normal | ||
Priority: | P5 - low | CC: | david |
Version: | unspecified | ||
Hardware: | All | ||
OS: | All | ||
GIT URL: | Change sponsored?: | --- | |
Patch complexity: | --- | Documentation contact: | |
Documentation submission: | Text to go in the release notes: | ||
Version(s) released in: | Circulation function: | ||
Bug Depends on: | 38503 | ||
Bug Blocks: | |||
Attachments: |
Bug 40169: Add a test
Bug 40169: mockData - Do not replace _id if passed Bug 40169: Add a test Bug 40169: mockData - Do not replace _id if passed |
Description
Jonathan Druart
2025-06-18 20:18:27 UTC
Created attachment 183350 [details] [review] Bug 40169: Add a test Created attachment 183351 [details] [review] Bug 40169: mockData - Do not replace _id if passed If we build an object and pass a primary key (ie. suffixed by _id) we should not replace it. Test plan: The test highlights the problem, it won't affect existing tests. 0. Apply only the first patch (Cypress tests) 1. Run yarn cypress run t/cypress/integration/t/mockData.ts => It fails 2. Apply this patch => It passes I had failed tests before and after the patches were applied: 1. Failed tests before the patches were applied: - ERM/DataProviders_spec.ts - ERM/UsageReports_spec.ts 2. Failed tests with both the patches applied: - ERM/DataProviders_spec.ts - ERM/UsageReports_spec.ts - KohaTable/Holdings_spec.ts (In reply to David Nind from comment #3) > I had failed tests before and after the patches were applied: > > 1. Failed tests before the patches were applied: > - ERM/DataProviders_spec.ts > - ERM/UsageReports_spec.ts > > 2. Failed tests with both the patches applied: > - ERM/DataProviders_spec.ts > - ERM/UsageReports_spec.ts > - KohaTable/Holdings_spec.ts Can you try again after a reset_all please? They all pass for me. If still failing, could you paste the output? (In reply to Jonathan Druart from comment #4) > (In reply to David Nind from comment #3) > > I had failed tests before and after the patches were applied: > > > > 1. Failed tests before the patches were applied: > > - ERM/DataProviders_spec.ts > > - ERM/UsageReports_spec.ts > > > > 2. Failed tests with both the patches applied: > > - ERM/DataProviders_spec.ts > > - ERM/UsageReports_spec.ts > > - KohaTable/Holdings_spec.ts > > Can you try again after a reset_all please? They all pass for me. > > If still failing, could you paste the output? Hum, the 2 ERM tests are indeed failing on main, and with this patch (so not related). Created attachment 183378 [details] [review] Bug 40169: Add a test Signed-off-by: David Nind <david@davidnind.com> Created attachment 183379 [details] [review] Bug 40169: mockData - Do not replace _id if passed If we build an object and pass a primary key (ie. suffixed by _id) we should not replace it. Test plan: The test highlights the problem, it won't affect existing tests. 0. Apply only the first patch (Cypress tests) 1. Run yarn cypress run t/cypress/integration/t/mockData.ts => It fails 2. Apply this patch => It passes Signed-off-by: David Nind <david@davidnind.com> The tests (excluding the ERM ones) now pass. Doing a reset_all seems to have done the trick. |