Skip to content

Update Vue specs to check for non-rendered v-ifs in a vue3 compatible way.

Sam Beckham requested to merge vtu-3-v-if into master

What does this MR do and why?

This MR replaces all instances of expect(wrapper.html()).toBe('') with expect(wrapper.isVisible()).toBe(false) as the former fails when testing in Vue 3 mode.

This is because Vue3 renders falsy v-ifs as a HTML comment.

Example failure:

Error: expect(received).toBe(expected) // Object.is equality

Expected: ""
Received: "<!--v-if-->"

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.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Run any of the tests in Vue 3 mode with VUE_VERSION=3 yarn jest [FILENAME]
Edited by Sam Beckham

Merge request reports

Loading