Switch to "propsData" to mount components in tests

What does this MR do and why?

The props mount option is not recognized in all cases when creating a wrapper.

Even though Vue Test Utils has changed its mount API, some tests may fail in when mount is used in VUE_VERSION=3 yarn jest.

This change also makes our tests consistent.

References

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Why this change?

group_runners_wait_times_spec.js was reported as failing in Vue 3. This was due to it using the props key when mounting a component, the failure looks like this:

image

After switching to propsData and fixing a missing assertion, the test passes with and without VUE_VERSION=3.

Additional changes

I wanted to check if any other spec files were using props (and failed for this reason). Locally, I added a check at node_modules/@vue/test-utils/dist/vue-test-utils.js and re-ran the test suite:

image

I found other specs used props and patched those, but there was no improvement in the Vue 3 suite, however I decided to leave those changes in for consistency.

How to set up and validate locally

VUE_VERSION=3 yarn jest ee/spec/frontend/ci/runner/group_runners_dashboard/group_runners_wait_times_spec.js
yarn jest ee/spec/frontend/ci/runner/group_runners_dashboard/group_runners_wait_times_spec.js

Related to #503489 (closed)

Edited by Miguel Rincon

Merge request reports

Loading