Skip to content

Fix spec violations in snippet header

Lorenz van Herwaarden requested to merge fix-spec-violations-snippet-header into master

What does this MR do and why?

In regards to epic &5102, this MR fixes the following spec violations in spec/frontend/snippets/components/snippet_header_spec.js #391173 (closed):

  • wrapper.vm or childComponent.vm modification
  • .setData() usage

The following things were changed:

  • Use createMockApollo to control query response so setData can be removed
  • Mimic actual user flow so internal methods don't need to be invoked/mocked

How to set up and validate locally

Run tests:

yarn jest spec/frontend/snippets/components/snippet_header_spec.js  

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Closes #391173 (closed)

Edited by Lorenz van Herwaarden

Merge request reports