Skip to content

Disallow Vue template refs in tests

What does this MR do and why?

This MR changes the recommendation for writing tests for Vue components. It prohibits the use of Vue template refs (this.$refs.element or wrapper.find({ ref: 'element' })). This is done because Vue template refs are an implementation detail of the component alongside data, methods and computeds. These refs could be changed at any point and should never cause the tests to break. To avoid these situations template refs should be prohibited in tests from now on.

Merge request reports