Remove instances of asserting with `wrapper.vm` in specs for `ci_variables_list`
The following discussion from !113171 (merged) should be addressed:
-
@f_caplette started a discussion: (+1 comment) Issue Due to the Vue3 Migration effort, I am more aware now that we should really try and avoid asserting anything off the VM whenever possible. I do have a proposal here that would require a bit of work but could make these tests pretty solid.
When we pass a function to
createMockApollo
that will return a promise with the data our query will return, we can instead usemockResolveValueOnce
and do it twice. The first time it returns what this specs currently return and then for the second instance, it returns a different data results, ideally with a different length.Then, when we want to make sure the data was refetched, we can make sure that the UI now displays the second data structure instead of the first.
That way, we are avoiding spying on
wrapper.vm
and we are also making sure the data was refetched.I am aware that we do this a bit everywhere already, so we can have a follow up if you feel this would bloat this MR a bit too much. WDYT?