Skip to content

Fix multiple-installation-warning snapshot padding after 4.0.0 bump#7603

Merged
craigmichaelmartin merged 1 commit into
mainfrom
fix/multiple-installation-warning-snapshot-4.0.0
May 22, 2026
Merged

Fix multiple-installation-warning snapshot padding after 4.0.0 bump#7603
craigmichaelmartin merged 1 commit into
mainfrom
fix/multiple-installation-warning-snapshot-4.0.0

Conversation

@craigmichaelmartin
Copy link
Copy Markdown
Contributor

WHY are these changes introduced?

Main CI started failing immediately after the 4.0.0 release was merged: https://github.com/Shopify/cli/actions/runs/26248300903

The showMultipleCLIWarningIfNeeded test uses inline snapshots that interpolate ${CLI_KIT_VERSION} into a UI info box rendered by cli-kit. The box auto-pads trailing whitespace to keep itself rectangular, so when CLI_KIT_VERSION shortened from 3.94.3 (6 chars) to 4.0.0 (5 chars), the renderer added one extra trailing space on the affected line. The snapshot's literal whitespace did not follow, so all three affected tests fail with a one-character mismatch:

- │  A global installation (v4.0.0) and a local dependency (v3.70.0) were       │
+ │  A global installation (v4.0.0) and a local dependency (v3.70.0) were        │

WHAT is this pull request doing?

Adds one trailing space before the closing on the three affected snapshot lines (33, 65, 98) in packages/cli-kit/src/public/node/plugins/multiple-installation-warning.test.ts.

The ${CLI_KIT_VERSION} template literal is preserved deliberately. vitest --update would inline v4.0.0, but keeping the template means future bumps that don't change the rendered length (the common case) won't re-break the test.

This snapshot remains brittle to any future change in the length of CLI_KIT_VERSION (e.g. 4.0.0 → 4.10.0 will break it again). A more robust fix would be to assert on the inner content only and not on the box geometry — out of scope for this PR but worth a follow-up.

How to test your changes?

cd packages/cli-kit
pnpm vitest run src/public/node/plugins/multiple-installation-warning.test.ts

All 5 tests pass.

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows) — whitespace-only change in a test fixture, no cross-platform implications
  • I've considered possible documentation changes — N/A
  • I've considered analytics changes to measure impact — N/A
  • The change is user-facing — No, test-only fix; no changeset needed

🤖 Generated with Claude Code

The inline snapshots in this test interpolate `${CLI_KIT_VERSION}`
into a UI box rendered by cli-kit's `info` renderer. The box auto-pads
trailing whitespace to keep the box rectangular, so when CLI_KIT_VERSION
shortened from 3.94.3 (6 chars) to 4.0.0 (5 chars), the renderer added
one extra trailing space. The snapshot's literal whitespace did not
follow, breaking main CI as soon as 4.0.0 landed.

Adds one trailing space before the closing `│` on the three affected
snapshot lines. Keeps the `${CLI_KIT_VERSION}` template literal rather
than inlining `v4.0.0` so future same-length version bumps don't trip
this again.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@craigmichaelmartin craigmichaelmartin requested a review from a team as a code owner May 21, 2026 19:56
@github-actions github-actions Bot added the no-changelog This PR doesn't include a changeset entry. Is an internal only change not relevant to end users. label May 21, 2026
@craigmichaelmartin craigmichaelmartin added this pull request to the merge queue May 22, 2026
Merged via the queue into main with commit 4d5f6c8 May 22, 2026
27 of 29 checks passed
@craigmichaelmartin craigmichaelmartin deleted the fix/multiple-installation-warning-snapshot-4.0.0 branch May 22, 2026 07:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog This PR doesn't include a changeset entry. Is an internal only change not relevant to end users.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants