When an test failure occurred, the report was not generated and the development server did not stop at the end of the test execution.
This was due to our custom function toMatchImageSnapshot becoming asynchronous in commit bffd25b.
The original function is synchronous, so the custom function must be too.
In addition to this fix, the logic of the code managing image attachments has been improved, mainly to better separate responsibilities.
Storing the expected image copy and calculating the image location are specific to j-i-s, so there's no need to do this. to j-i-s, and are therefore performed first.
The function for attaching images to the report only uses the previously calculated image location and is unaware that j-i-s is being used.
For tests that redefined the location of output images (usually in a subfolder), the path to the received images was not updated accordingly. It was stored in the same location for each test, so only one file was kept and not stored with the diff and the expected image.
Also regenerate the image for the “subprocess.03.collapsed.with.elements” test.
Previously, the test failed when run with firefox and this was for good reasons that were hidden with other browsers due to the threshold value used.
The sub-process on the top left is a "collapsed adhoc sub-process", so 2 markers must be displayed with a space between them. Currently, the adhoc marker is not displayed, but the expand marker is correctly positioned (not centered, but on the left) as if the adhoc marker were displayed.
Commit c0c50aa0 removed additional spacing between markers, so the expand marker has moved to the right. But the reference snapshot was not updated accordingly.
The test probably accepted a minor visual change like this, but at some point the new version of Firefox added other changes that are above the threshold, and the error now appears.
The problem didn't occur on macOS because the threshold was increased in commit bfa02fcc, but this hid the problem.
When an test failure occurred, the report was not generated and the development server did not stop at the end of the test execution. This was due to our custom function
toMatchImageSnapshot
becoming asynchronous in commit bffd25b. The original function is synchronous, so the custom function must be too.In addition to this fix, the logic of the code managing image attachments has been improved, mainly to better separate responsibilities. Storing the expected image copy and calculating the image location are specific to j-i-s, so there's no need to do this. to j-i-s, and are therefore performed first. The function for attaching images to the report only uses the previously calculated image location and is unaware that j-i-s is being used.
For tests that redefined the location of output images (usually in a subfolder), the path to the received images was not updated accordingly. It was stored in the same location for each test, so only one file was kept and not stored with the diff and the expected image.
Also regenerate the image for the “subprocess.03.collapsed.with.elements” test.
Notes
First detection of problems fixed in this PR:
Error reproductions and progressive fix with the "overlays" e2e tests
Command run:
DEBUG=bv:test:jest:img npm run test:e2e -- --runTestsByPath test/e2e/overlays.rendering.test.ts
Examples of reports generated with all tests involving "custom received directory"