fix(tests): update GlobalError test to handle multiple text matches#804
Open
vdimarco wants to merge 4 commits into
Open
fix(tests): update GlobalError test to handle multiple text matches#804vdimarco wants to merge 4 commits into
vdimarco wants to merge 4 commits into
Conversation
The desktop app was showing 'Something went wrong' because NEXT_PUBLIC_PRIVY_APP_ID was not set during the build. Added required environment variables from secrets.
The tray icon was being created twice - once by the trayIcon config in tauri.conf.json and once programmatically in lib.rs setup_tray(). This caused two Gatewayz icons to appear in the Windows taskbar. Removed the config since the code handles it.
- Add 'Show error details' button visible only in desktop app - Display full error name, message, and stack trace - Console log errors for debugging - Helps diagnose 'Something went wrong' errors when DevTools unavailable
The test was looking for exact text 'Test error message' but the component renders it in a format that includes the error name: 'Error: Test error message'. Additionally, the error message appears in both the error display and stack trace. Updated test to use getAllByText with a regex matcher to properly handle this. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GlobalError/should display error message in development modeChanges
getAllByTextwith a regex matcher instead ofgetByTextwith exact stringError: <name>: <message>and the message also appears in the stack traceTest plan
pnpm exec jest src/app/__tests__/global-error.test.tsxRelated
🤖 Generated with Claude Code
Greptile Summary
Fixed failing test for
GlobalErrorcomponent by updating the test to handle multiple occurrences of the error message usinggetAllByTextwith a regex matcher. The component now displays error details in the formatError: <name>: <message>and includes the stack trace, causing the message to appear multiple times in the DOM.Additionally enhanced the desktop app with:
error.name,error.message,error.stack)NEXT_PUBLIC_PRIVY_APP_ID, API URLs)Confidence Score: 5/5
Important Files Changed
getAllByTextwith regex matcher to handle multiple occurrences of error message (in both error display and stack trace), fixing test failureNEXT_PUBLIC_PRIVY_APP_ID,NEXT_PUBLIC_API_BASE_URL,NEXT_PUBLIC_CHAT_HISTORY_API_URL) for desktop app buildSequence Diagram
sequenceDiagram participant Test as Test Suite participant Component as GlobalError Component participant Sentry as Sentry SDK participant Console as Console (Desktop) participant DOM as DOM Test->>Component: render(<GlobalError error={mockError} reset={mockReset} />) Component->>Sentry: captureException(error, context) Sentry-->>Component: Error logged alt Desktop App Component->>Console: console.error('[GlobalError] Error caught:', error) Component->>Console: console.error('[GlobalError] Error name:', error.name) Component->>Console: console.error('[GlobalError] Error message:', error.message) Component->>Console: console.error('[GlobalError] Error stack:', error.stack) end Component->>DOM: Render error UI Note over Component,DOM: Format: "Error: {error.name}: {error.message}" alt Development Mode OR showDetails=true Component->>DOM: Render error details section DOM->>DOM: Display error name, message DOM->>DOM: Display stack trace (contains message again) end alt Desktop App && !showDetails && Production Component->>DOM: Render "Show error details" button end Test->>DOM: getAllByText(/Test error message/i) DOM-->>Test: Returns array of matching elements Test->>Test: expect(errorMessages.length).toBeGreaterThan(0) Test-->>Test: ✓ Test passes