test: fix GlobalError test to match updated error display format #808
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 modescreen.getByText('Test error message')which failed because the component now rendersError: {error.name}: {error.message}formatChanges
src/app/__tests__/global-error.test.tsxto use a function matcher instead of exact text matchTest plan
🤖 Generated with Claude Code
Greptile Summary
This PR fixes a failing test in the GlobalError component test suite. The test was updated to match the component's error display format which was changed in a previous commit.
The PR also includes several unrelated fixes for the Tauri desktop app:
tauri.conf.jsonMain Changes:
global-error.test.tsxto use a function matcher instead of exact text matching to accommodate the error format:Error: {error.name}: {error.message}isTauriDesktop()function to disable embedded wallets on Tauri apps (tauri.localhost is not HTTPS)Confidence Score: 5/5
Important Files Changed
Error: {error.name}: {error.message})Sequence Diagram
sequenceDiagram participant Test as Test Suite participant Component as GlobalError Component participant DOM as Rendered DOM Note over Test,DOM: Test Execution Flow Test->>Component: render(<GlobalError error={mockError} reset={mockReset} />) Component->>Component: Format error message as "Error: {error.name}: {error.message}" Component->>DOM: Render error details in <p> tag Note over Test,DOM: Previous Test (Failed) Test->>DOM: screen.getByText('Test error message') DOM-->>Test: ❌ Not found (exact match failed) Note over Test,DOM: Updated Test (Passes) Test->>DOM: screen.getByText((content, element) => {...}) DOM->>DOM: Check element.tagName === 'P' DOM->>DOM: Check content.includes('Test error message') DOM-->>Test: ✅ Found matching element