Skip to content

frontend: Fix frontend tests after rebase - #331

Merged
René Dudfield (illume) merged 4 commits into
Azure:headlamp-downstreamfrom
sniok:fix-frontend-tests
Feb 26, 2026
Merged

frontend: Fix frontend tests after rebase#331
René Dudfield (illume) merged 4 commits into
Azure:headlamp-downstreamfrom
sniok:fix-frontend-tests

Conversation

@sniok

Copy link
Copy Markdown
Collaborator

This PR fixes various test failures after rebasing

EmptyContent is now generating more deterministic snapshots, updated those
LogsButton test from upstream was fixed because we have modified logs in aks-desktop
runPlugin test was failing because aks-desktop value was missing

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes test failures that occurred after rebasing with upstream changes. The changes address three main areas: updated expectations for plugin identification tests, more deterministic snapshot generation for EmptyContent, and refactored LogsButton tests to match upstream changes that now use Pod.useList instead of direct API calls.

Changes:

  • Updated identifyPackages test expectations to include the aks-desktop package status in all test cases
  • Changed EmptyContent component to use setTimeout instead of requestAnimationFrame for more deterministic snapshot generation
  • Refactored LogsButton tests to mock Pod.useList static method, aligning with upstream changes to the LogsViewer implementation
  • Updated snapshots for EmptyContent-based components to reflect the more deterministic rendering behavior

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
frontend/src/plugin/runPlugin.test.ts Updated test expectations to include aks-desktop package status alongside @headlamp-k8s/minikube
frontend/src/components/common/EmptyContent.tsx Changed from requestAnimationFrame to setTimeout for more deterministic test snapshots
frontend/src/components/common/Resource/LogsButton.test.tsx Refactored to mock Pod.useList static method, updated test descriptions and assertions to match new upstream implementation
frontend/src/components/common/snapshots/EmptyContent.WithMultipleChildren.stories.storyshot Updated snapshot to show rendered content from EmptyContent timing change
frontend/src/components/App/Settings/snapshots/SettingsClusters.NullClusterState.stories.storyshot Updated snapshot to show rendered content from EmptyContent timing change
frontend/src/components/App/Settings/snapshots/SettingsClusters.EmptyClusterList.stories.storyshot Updated snapshot to show rendered content from EmptyContent timing change
frontend/src/components/App/PluginSettings/snapshots/PluginSettings.Empty.stories.storyshot Updated snapshot to show rendered content from EmptyContent timing change

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@illume

René Dudfield (illume) commented Feb 26, 2026

Copy link
Copy Markdown
Collaborator

Looks like i18n check is failing.

npm run i18n

Apps failures... I merged the other PR for fixing them.

@illume René Dudfield (illume) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🎉 thanks!

@illume
René Dudfield (illume) merged commit 02feb87 into Azure:headlamp-downstream Feb 26, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants