Skip to content

fix(greenhouse): upgrade Vitest to 4.1.6#1697

Merged
ArtieReus merged 11 commits into
mainfrom
arite-upgrade-vitest-416
May 19, 2026
Merged

fix(greenhouse): upgrade Vitest to 4.1.6#1697
ArtieReus merged 11 commits into
mainfrom
arite-upgrade-vitest-416

Conversation

@ArtieReus
Copy link
Copy Markdown
Collaborator

Summary

This PR fixes the text overlap issue in the ReadinessConditions component where long condition names were overlapping with their values. Additionally, it upgrades Vitest from 3.2.4 to 4.1.6 across the entire monorepo, following the official migration guide.

Changes Made

UI Fixes

  • Fixed ReadinessConditions component layout to prevent text overlap with long condition names
  • Updated grid column classes to be responsive: w-2/5 md:w-1/3 lg:w-1/5 xl:w-1/6 with proper text wrapping
  • Columns now properly shrink and wrap text on smaller screens while maintaining readability

Vitest 4.1.6 Migration

  • Upgraded Vitest from 3.2.4 to 4.1.6 across all packages and apps
  • Migrated 15+ vitest.setup.ts files to use @testing-library/jest-dom/vitest import pattern
  • Removed unnecessary global.window and global.document assignments (jsdom provides these automatically)
  • Updated all mock constructors (IntersectionObserver, ResizeObserver, https.Agent) to use class syntax required by Vitest 4
  • Changed all global.fetch assignments to use vi.stubGlobal('fetch', mockFetch) pattern
  • Fixed TypeScript configurations for oauth and k8s-client packages:
    • Added "lib": ["ES2017", "DOM"] for Object.values() and browser API support
    • Added "types": ["vitest/globals", "node"] for proper Node.js type support
  • Fixed import statements (changed from node:test to vitest)
  • Updated vi.spyOn type annotations to use MockInstance type for Vitest 4 compatibility
  • Added temporary ESLint rule overrides for k8s-client package with TODO comments for future cleanup

Related Issues

  • Fixes text overlap in ReadinessConditions component (greenhouse app)
  • Upgrades testing infrastructure to latest Vitest version

Testing Instructions

  1. pnpm i
  2. pnpm lint - Verify all lint checks pass
  3. pnpm typecheck - Verify all TypeScript checks pass
  4. pnpm test - Verify all tests pass with Vitest 4.1.6
  5. For ReadinessConditions UI fix:
    • Run greenhouse app locally
    • Navigate to a page displaying ReadinessConditions
    • Resize browser window to verify responsive behavior
    • Verify long condition names (like "HelmReleaseCreated") no longer overlap with values

Checklist

  • I have performed a self-review of my code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.
  • I have made corresponding changes to the documentation (if applicable).
  • My changes generate no new warnings or errors.
  • I have created a changeset for my changes.

PR Manifesto

Review the PR Manifesto for best practises.

ArtieReus added 9 commits May 18, 2026 13:02
Signed-off-by: Arturo Reuschenbach Puncernau <reuschenbach@gmail.com>
Signed-off-by: Arturo Reuschenbach Puncernau <reuschenbach@gmail.com>
Signed-off-by: Arturo Reuschenbach Puncernau <reuschenbach@gmail.com>
Signed-off-by: Arturo Reuschenbach Puncernau <reuschenbach@gmail.com>
Signed-off-by: Arturo Reuschenbach Puncernau <reuschenbach@gmail.com>
Signed-off-by: Arturo Reuschenbach Puncernau <reuschenbach@gmail.com>
Signed-off-by: Arturo Reuschenbach Puncernau <reuschenbach@gmail.com>
Signed-off-by: Arturo Reuschenbach Puncernau <reuschenbach@gmail.com>
Signed-off-by: Arturo Reuschenbach Puncernau <reuschenbach@gmail.com>
Copilot AI review requested due to automatic review settings May 18, 2026 11:42
@ArtieReus ArtieReus requested review from a team and franzheidl as code owners May 18, 2026 11:42
@ArtieReus ArtieReus self-assigned this May 18, 2026
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 18, 2026

⚠️ No Changeset found

Latest commit: 607b689

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@ArtieReus ArtieReus added the greenhouse-pr-build Set this label to create a preview image which will automatically set the `greenhouse-pr-preview` label May 18, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 18, 2026

PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-05-19 12:20 UTC

@github-actions github-actions Bot added the greenhouse-pr-preview THIS LABEL IS SET AUTOMATICALLY. label May 18, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@ArtieReus ArtieReus requested a review from Copilot May 18, 2026 12:22
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@ArtieReus
Copy link
Copy Markdown
Collaborator Author

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

You've hit your rate limit. Please wait for your limit to reset in 1 hour 50 minutes or switch to auto model to continue. 🤦

@ArtieReus ArtieReus changed the title fix(greenhouse): improve ReadinessConditions layout responsiveness and upgrade Vitest to 4.1.6 fix(greenhouse): upgrade Vitest to 4.1.6 May 18, 2026
@ArtieReus ArtieReus requested a review from Copilot May 18, 2026 15:50
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 46 out of 47 changed files in this pull request and generated 3 comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (1)

packages/k8s-client/test/client.test.ts:66

  • vi.stubGlobal('fetch', ...) is not reverted by vi.restoreAllMocks(). Without an explicit cleanup (e.g. vi.unstubAllGlobals() / restoring the prior fetch), the stubbed fetch can leak into other tests in the same worker.
  beforeEach(() => {
    vi.clearAllMocks()

    // Set up default successful response
    mockFetch.mockResolvedValue(createMockResponse({ success: true }))
    vi.stubGlobal("fetch", mockFetch)
  })

  afterEach(() => {
    vi.restoreAllMocks()
  })

Comment thread packages/k8s-client/test/request.test.ts
Comment thread packages/k8s-client/eslint.config.mjs
Comment thread packages/oauth/__tests__/oidcConfig.test.ts
Signed-off-by: Arturo Reuschenbach Puncernau <reuschenbach@gmail.com>
@github-actions github-actions Bot added greenhouse-pr-preview THIS LABEL IS SET AUTOMATICALLY. and removed greenhouse-pr-preview THIS LABEL IS SET AUTOMATICALLY. labels May 19, 2026
@ArtieReus ArtieReus merged commit ef79d92 into main May 19, 2026
25 checks passed
@ArtieReus ArtieReus deleted the arite-upgrade-vitest-416 branch May 19, 2026 12:20
@github-actions github-actions Bot removed the greenhouse-pr-preview THIS LABEL IS SET AUTOMATICALLY. label May 19, 2026
@ArtieReus ArtieReus linked an issue May 19, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

greenhouse-pr-build Set this label to create a preview image which will automatically set the `greenhouse-pr-preview`

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Task] (Juno): Upgrade vitest from v3.x.x to v4.x.x

4 participants