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.jobMetaDataReloadPeriod value from cvat-core/src/config.ts
  • temporarily set jobMetaDataReloadPeriod to 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/meta is 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 PATCH to /data/meta.
  • Intercept the request to validate that response has deleted_frames property, that it's an Array and that it contains the deleted frame number frameNum
  • Assert that deleted_frames array contains one element: frameNum

Tear down

  • Set jobMetaDataReloadPeriod back to the saved default value

Checklist

  • I submit my changes into the develop branch
  • 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.

Merge request reports

Loading