Skip to content

Improve value_stream_form_content_spec.js

What does this MR do and why?

Currently the jest tests in ee/spec/frontend/analytics/cycle_analytics/components/value_stream_form_spec.js rely on checking the wrapper.vm object for correct values.

This goes against our testing guidelines of don't test the library. We should instead test against the rendered output and make use of finders where it makes sense.

Changes:

  • Convert tests that rely on emitted events to use async/await
  • Remove unneeded nextTick()
  • Add finders for selecting stages more granularly
  • Improve stages tests by using rendered output instead of wrapper.vm.stages value
  • Improve error tests by using rendered output instead of wrapper.vm.nameError value

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

How to set up and validate locally

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

MR acceptance checklist

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

Related to #323889 (closed)

Merge request reports

Loading