Add flow version pinning integration tests

Summary

Adds integration tests verifying flow version pinning wiring across namespaces, edit page version warning, duplicate page definition pre-fill, and version alert mutation wiring in the context of real namespace and consumer ID resolution.

version_alert_spec.js covers the VersionAlert component in isolation. These integration tests additionally prove that the consumer ID resolved from the real namespace wiring reaches the mutation, and that the version key reset and toast fire in the context of the full page tree.

Test cases (11 tests)

Show page (3 tests):

  • Project namespace: shows pinned version and version alert
  • Group namespace: shows group pinned version and version alert
  • Explore namespace: shows latest version and no version alert

Edit page (2 tests):

  • Warns that only the latest version is editable when pinned version differs
  • Does not warn when already viewing the latest version

Duplicate page (3 tests):

  • Pre-fills definition from project pinned version on project namespace
  • Pre-fills definition from group pinned version on group namespace
  • Pre-fills definition from latest version on explore namespace

Version alert + mutation (3 tests):

  • Clicking "View latest version" switches displayed content to latest version
  • Clicking "Update" fires mutation with correct consumer ID and version prefix
  • Successful update resets to pinned view and shows toast

Infrastructure

  • Adds createFlowWithPermissions() factory to mock_data_factories.js

How to verify

yarn jest ee/spec/frontend/ai/catalog/integration/flow_version_pinning_integration_spec.js
VUE_VERSION=3 yarn jest ee/spec/frontend/ai/catalog/integration/flow_version_pinning_integration_spec.js
Edited by Angus Ryer

Merge request reports

Loading
Loading