Test to confirm correct UI and cache state after frame deletion
Motivation and context
Fix #8872 dealt with incorrect states of UI and cache after frame deletion. The frame was not being deleted and the cache was not updated properly to reflect the changes.
How has this been tested?
Set up
- open Main task job
- save default
cvat.config.jobMetaDataReloadPeriodvalue fromcvat-core/src/config.ts - temporarily set
jobMetaDataReloadPeriodto a small value (100 ms) for the sake of easier testing
Test suite
- Inside the job, wait for the small job metadata reload period to elapse
- Transition to the next frame by clicking the next button on the player
- Verify that
GET /data/metais sent and that the response has frames in it. - Save current frame number to the variable
frameNum - Delete the frame: click on the bin, click on 'Delete' button in the modal
- Ensure that 'Restore frame' button is absent
- Make sure that the frame is deleted by asserting that current frame has number
frameNum + 1(the next frame in the dataset) - Click Save to send
PATCHto/data/meta. - Intercept the request to validate that response has
deleted_framesproperty, that it's anArrayand that it contains the deleted frame numberframeNum - Assert that
deleted_framesarray contains one element:frameNum
Tear down
- Set
jobMetaDataReloadPeriodback to the saved default value
Checklist
-
I submit my changes into the developbranch -
I have created a changelog fragment -
I have updated the documentation accordingly -
I have added tests to cover my changes -
I have linked related issues (see GitHub docs) -
I have increased versions of npm packages if it is necessary (cvat-canvas, cvat-core, cvat-data and cvat-ui)
License
-
I submit my code changes under the same MIT License that covers the project. Feel free to contact the maintainers if that's a concern.