Improve the AR manifest detail feature spec
What does this MR do and why?
Items 1 to 5 of the review follow-ups on ee/spec/features/artifact_registry/manifest_detail_spec.rb from the review of !257027 (merged). All are test-only; no production change.
- Add a not-found case: when Artifact Registry returns
nilfor the manifest, the page renders the in-SPA "Page not found" state (ManifestResolverreturns nil,manifest_detail.vuerenders the sharedNotFound). Mirrors the versions spec's "an artifact Artifact Registry does not hold". It also asserts the manifest read happened once with the requested digest, because the router's catch-all route and a null repository render the same heading. - Convert the four shared locals (
slug,name,format,artifact_id) tolet, matching the sibling feature specs; buildmanifest_page_pathonversions_page_path; and name the referrer short digest (referrer_short_digest) like the other short digests instead of inlining'c3c3c3c3c3c3'. Only these four are converted, keeping the group under theRSpec/MultipleMemoizedHelperslimit of 25 (now 22). - Drive the referrers pager with
click_button 'Next'/have_button('Next', disabled: false)(and Previous) instead offind_by_testid('nextButton');GlKeysetPaginationlabels its buttons, andhave_buttonwaits for the state. Matchescontainer_registry_spec.rb. - Drop the
have_receivedon the next-page example, whose cursor check was redundant: only the keyed stub (cursor: next_cursor) returns thee4page, so thee4digest on the page already proves the cursor reached the client. The catch-all stub answers every other call with page one. The previous-pagehave_receivedstays, because no stub matchesprev_cursor, so a wrong cursor would still render page one; it catches a bug the next-page assertion cannot. - Share
index_attributesandchild_attributesbase hashes between the list-rowManifest.newand the detailManifestDetail.newfixtures (same five identity fields), merging the detail-only keys on top.
Out of scope: item 6 of the issue (a shared RSpec context across the four AR feature specs) touches sibling files, so it is left for a dedicated follow-up MR as the issue suggests.
No changelog: test-only change.
References
- Related to #630526 (closed) (item 6 of the issue is a separate follow-up, so the issue stays open)
- Follow-up to !257027 (merged)
Screenshots or screen recordings
Not applicable; test-only change.
How to set up and validate locally
This is a :js feature spec (run locally: 10 examples, 0 failures). It exercises the manifest detail SPA with Artifact Registry stubbed through the client, so no running Artifact Registry is needed.
VITE_ENABLED=true bin/rspec ee/spec/features/artifact_registry/manifest_detail_spec.rbMR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.