Upgrade @vue/test-utils to latest version
What does this MR do?
This MR upgrades @vue/test-utils
to latest version.
Since this MR is huge and we need all these changes to arrive simultaneously, I suggest reviewing it per-commit basics. Here's how these commits were generated:
For next steps I'm directly hacking node_modules/@vue/test-utils/dist/vue-test-utils.js
to generate separate commits. New version of @vue/test-utils
introduced two major changes affecting almost every snapshot in our code:
- replaced stub naming logic (was:
gllink-stub
, now:gl-link-stub
) -
html()
calls are automatically prettified
-
node_modules/@vue/test-utils/dist/vue-test-utils.js
line 2014 (at top ofcreateStubFromComponent
). Add
if (name !== 'router-link') { name = name.replace(/-/g, ''); }
This simulates old naming scheme, so we can verify snapshot changes
-
node_modules/@vue/test-utils/dist/vue-test-utils.js
line 8082 (start of functionvar pretty
)
return str;
(short-circuiting function, disabling HTML prettifying)
-
077dbba1 - Running
yarn jest -u
to update snapshots. This updates just two files.ee/spec/frontend/design_management/components/list/__snapshots__/item_spec.js.snap
in this commit is hard to follow due to snapshot order change in file, but this one we can't control :(. This commit ensures that migration to async tests is done properly and we do not fail our snapshots -
fa07e8b4 - Reverting changes in step 4, I'm updating HTML-based snapshots
-
242b6a3f - Reverting changes in step 3. Updating remaining snapshots
Closes #195164 (closed)