Replace vm.destroy with wrapper.destroy to fix spec in Vue 3 mode
What does this MR do and why?
Fixes ee/spec/frontend/analytics/devops_reports/devops_adoption/components/devops_adoption_app_spec.js
This spec:
DevopsAdoptionApp enabled namespaces data data polling clears pollTableData interval when destroying / ee/spec/frontend/analytics/devops_reports/devops_adoption/components/devops_adoption_app_spec.js (0.045s)
Error: expect(jest.fn()).toHaveBeenCalledWith(...expected)
Expected: 1234
Number of calls: 0
at Object.toHaveBeenCalledWith (/builds/gitlab-org/gitlab/ee/spec/frontend/analytics/devops_reports/devops_adoption/components/devops_adoption_app_spec.js:360:38)
at Object.asyncJestTest (/builds/gitlab-org/gitlab/node_modules/jest-jasmine2/build/jasmineAsyncInstall.js:125:37)
at /builds/gitlab-org/gitlab/node_modules/jest-jasmine2/build/queueRunner.js:41:12
at new Promise (<anonymous>)
at mapper (/builds/gitlab-org/gitlab/node_modules/jest-jasmine2/build/queueRunner.js:28:19)
at /builds/gitlab-org/gitlab/node_modules/jest-jasmine2/build/queueRunner.js:68:41
And one failing spec of: spec/frontend/issues/show/components/app_spec.js:
Issuable output sticky header document body class removes the css class from the document body when unmounting / spec/frontend/issues/show/components/app_spec.js (0.018s)
Error: expect(received).toBe(expected) // Object.is equality
Expected: false
Received: true
at Object.toBe (/builds/gitlab-org/gitlab/spec/frontend/issues/show/components/app_spec.js:392:85)
at Object.asyncJestTest (/builds/gitlab-org/gitlab/node_modules/jest-jasmine2/build/jasmineAsyncInstall.js:125:37)
at /builds/gitlab-org/gitlab/node_modules/jest-jasmine2/build/queueRunner.js:41:12
at new Promise (<anonymous>)
at mapper (/builds/gitlab-org/gitlab/node_modules/jest-jasmine2/build/queueRunner.js:28:19)
at /builds/gitlab-org/gitlab/node_modules/jest-jasmine2/build/queueRunner.js:68:41
at runNextTicks (node:internal/process/task_queues:60:5)
at processImmediate (node:internal/timers:449:9)
Screenshots or screen recordings
No visual changes
How to set up and validate locally
Execute
yarn jest ee/spec/frontend/analytics/devops_reports/devops_adoption/components/devops_adoption_app_spec.js
yarn jest spec/frontend/issues/show/components/app_spec.js
VUE_VERSION=3 yarn jest ee/spec/frontend/analytics/devops_reports/devops_adoption/components/devops_adoption_app_spec.js
VUE_VERSION=3 yarn jest spec/frontend/issues/show/components/app_spec.js
The 2nd file will now have 2 instead of 3 failed specs.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Related to #552320
Edited by Vanessa Otto