Skip to content

🐛 fix NotFound.test.tsx: add i18n mock for t() translation keys#19325

Merged
clubanderson merged 4 commits into
mainfrom
scanner/fix-19323
Jun 21, 2026
Merged

🐛 fix NotFound.test.tsx: add i18n mock for t() translation keys#19325
clubanderson merged 4 commits into
mainfrom
scanner/fix-19323

Conversation

@clubanderson

Copy link
Copy Markdown
Collaborator

Fixes #19323

PR #19321 wrapped NotFound.tsx raw strings in t() calls but did not update the test file. This adds the react-i18next mock following the same pattern used by other test files (e.g., ACMMIntroModal.test.tsx).

Changes

  • Added vi.mock('react-i18next') to NotFound.test.tsx
  • Mapped all translation keys to their English values from common.json
  • All 5 failing tests now pass with the mocked translation function

Translation keys mapped

  • notFound.title → "Page not found"
  • notFound.pathDoesNotExist → "doesn't exist yet — but it could!"
  • notFound.shipFast → "Ship it in hours, not months"
  • notFound.aiAutomation → Full automation description
  • notFound.requestFeature → "Request this feature"
  • notFound.popularPages → "Popular pages"
  • notFound.goBack → "Go back"
  • notFound.home → "Home"
  • notFound.quickLinks.* → Dashboard, Clusters, Compliance, Deploy, Marketplace, Cost

PR #19321 wrapped NotFound.tsx raw strings in t() calls but did not 
update the test. This adds the react-i18next mock following the same 
pattern used by other test files.

Fixes #19323

Signed-off-by: GitHub Copilot Scanner <scanner@kubestellar.io>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 21, 2026 01:38
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Jun 21, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign eeshaansa for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@netlify

netlify Bot commented Jun 21, 2026

Copy link
Copy Markdown

Deploy Preview for kubestellarconsole ready!

Name Link
🔨 Latest commit b6cb7a1
🔍 Latest deploy log https://app.netlify.com/projects/kubestellarconsole/deploys/6a374b3eda32d60008766430
😎 Deploy Preview https://deploy-preview-19325.console-deploy-preview.kubestellar.io
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions

Copy link
Copy Markdown
Contributor

👋 Hey @clubanderson — thanks for opening this PR!

🤖 This project is developed exclusively using AI coding assistants.

Please do not attempt to code anything for this project manually.
All contributions should be authored using an AI coding tool such as:

This ensures consistency in code style, architecture patterns, test coverage,
and commit quality across the entire codebase.


This is an automated message.

@github-actions github-actions Bot added the ai-generated Pull request generated by AI label Jun 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🐝 Hi @clubanderson! I'm kubestellar-hive[bot], an automation bot for this repo.

Trusted users — org members and contributors with write access — can mention @kubestellar-hive in a comment to trigger repo automation.
On issues, that mention queues an automated fix attempt. On pull requests, it records extra context for existing automation.
This is not an interactive Q&A bot, so mentions should be treated as requests for automation rather than a conversation.

Automation may take a moment to start, and follow-up happens through workflow activity rather than chat replies.

@kubestellar-prow kubestellar-prow Bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jun 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

✅ Test Coverage Check

All new source files in this PR have corresponding test files.

Checked web/src/hooks/ and web/src/components/ against origin/main.

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 updates the NotFound component test suite to mock react-i18next so the tests continue to validate the rendered English copy after NotFound.tsx switched to t() translation keys.

Changes:

  • Added a react-i18next mock in NotFound.test.tsx with a t() function returning English strings.
  • Updated one assertion to match the rendered em dash character in the NotFound description text.

Comment on lines +13 to +29
const map: Record<string, string> = {
'notFound.title': 'Page not found',
'notFound.pathDoesNotExist': "doesn't exist yet — but it could!",
'notFound.shipFast': 'Ship it in hours, not months',
'notFound.aiAutomation': 'KubeStellar Console uses AI-powered repo automation to go from feature request to production in hours. Open an issue and watch the magic happen.',
'notFound.requestFeature': 'Request this feature',
'notFound.popularPages': 'Popular pages',
'notFound.goBack': 'Go back',
'notFound.home': 'Home',
'notFound.quickLinks.dashboard': 'Dashboard',
'notFound.quickLinks.clusters': 'Clusters',
'notFound.quickLinks.compliance': 'Compliance',
'notFound.quickLinks.deploy': 'Deploy',
'notFound.quickLinks.marketplace': 'Marketplace',
'notFound.quickLinks.cost': 'Cost',
}
return map[key] || key
Component used nonexistent keys (description, ctaTitle, ctaDescription,
ctaButton, quickLinks.*) — corrected to match actual common.json keys
(pathDoesNotExist, shipFast, aiAutomation, requestFeature,
notFound.quickLinks.*).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: clubanderson <clubanderson@users.noreply.github.com>
@kubestellar-prow kubestellar-prow Bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jun 21, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Hive Scanner <hive-scanner@kubestellar.local>
@kubestellar-prow kubestellar-prow Bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 21, 2026
@clubanderson clubanderson merged commit 26d726a into main Jun 21, 2026
35 of 43 checks passed
@kubestellar-prow kubestellar-prow Bot deleted the scanner/fix-19323 branch June 21, 2026 03:01
@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Your PR has been merged.

Check out what's new:

Stay connected: Slack #kubestellar-dev | Multi-Cluster Survey

@github-actions

Copy link
Copy Markdown
Contributor

Post-merge build verification passed

Both Go and frontend builds compiled successfully against merge commit 26d726aa788e4833090b7b28980a5b13a5069fa2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-generated Pull request generated by AI dco-signoff: yes Indicates the PR's author has signed the DCO. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. tier/1-lightweight

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛 5 test failure(s) in Coverage Suite run #3833

2 participants