fix(test): fix global-error test text matcher for split elements#803
Open
vdimarco wants to merge 4 commits into
Open
fix(test): fix global-error test text matcher for split elements#803vdimarco 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 error message is rendered as "Error: {error.name}: {error.message}"
which splits the text across multiple elements. Updated the test to use
container.querySelector and textContent check instead of getByText for
exact text matching.
🤖 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
should display error message in development modetest inglobal-error.test.tsxProblem
The error message in
GlobalErrorcomponent is rendered as:This splits the text across multiple elements, so
getByText('Test error message')fails because the text is not in a single element.Solution
Changed the test to use
container.querySelector('.bg-muted')and checktextContentcontains the error message instead of usinggetByTextfor exact matching.Test plan
🤖 Generated with Claude Code
Greptile Summary
Fixed failing test in
global-error.test.tsxby changing the test matcher to check containertextContentinstead of usinggetByTextfor exact matching. The error message is rendered as<strong>Error:</strong> {error.name}: {error.message}, which splits the text across multiple elements, causing the original test to fail.Additional changes bundled in this PR:
GlobalErrorcomponent with console logging and a "Show error details" button for desktop usersNEXT_PUBLIC_PRIVY_APP_IDand API base URL environment variables to desktop build workflowtauri.conf.jsonKey improvements:
Confidence Score: 5/5
Important Files Changed
NEXT_PUBLICenvironment variables for Privy authentication in desktop buildsSequence Diagram
sequenceDiagram participant App as React App participant GE as GlobalError Component participant Sentry as Sentry participant Console as Console participant UI as User Interface App->>GE: Error thrown at root level activate GE GE->>GE: useEffect triggered with error GE->>Sentry: captureException(error, context) Note over Sentry: Logs error with tags:<br/>error_type: 'global_error'<br/>error_boundary: 'root' GE->>Console: console.error(error details) Note over Console: Desktop debugging logs:<br/>- Error object<br/>- Error name<br/>- Error message<br/>- Error stack GE->>GE: Check environment & desktop mode Note over GE: isDesktop = '__TAURI__' in window<br/>showDetails state initialized alt Development Mode GE->>UI: Display error details automatically Note over UI: Shows .bg-muted container with:<br/>Error: {name}: {message}<br/>Stack trace<br/>Error digest (if present) else Desktop (Production) GE->>UI: Display "Show error details" button UI->>GE: User clicks button GE->>GE: setShowDetails(true) GE->>UI: Display error details else Production (Non-Desktop) GE->>UI: Hide error details Note over UI: Only shows user-friendly message end GE->>UI: Render error UI Note over UI: - Error icon<br/>- "Something went wrong"<br/>- Try again button<br/>- Homepage button<br/>- Support email link UI->>GE: User clicks "Try again" GE->>App: Call reset() Note over App: Attempts to re-render<br/>error boundary deactivate GE