fix(mobile): remove mock receipt fallback from production - #1074
Open
martinshub-tech wants to merge 1 commit into
Open
martinshub-tech wants to merge 1 commit into
martinshub-tech wants to merge 1 commit into
Conversation
Resolves issue where receipt screen would fall back to an invented receipt if transaction details were incomplete. The mock fixture has been moved to tests, and eslint configuration updated to prevent mock imports in production modules.
|
@martinshub-tech Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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.
Closes #847
I've resolved the issue according to all the acceptance criteria and created a new branch fix-mock-receipt with the commit. The changes address the following:
Moved Mock Fixture: app/mobile/src/data/mockReceipt.ts has been safely moved to app/mobile/tests/fixtures/mockReceipt.ts, and all the test files utilizing it have had their imports updated.
Removed Invented Fallback & Added Error States: Instead of deriving a mock fallback object when transaction isn't resolved in app/mobile/app/transaction/[id].tsx, the component now returns null for the transaction in that case, and properly renders an whilst hydrating, and a clear "Receipt not found" error state with an alert icon when no data is found.
CI Strict Rules Added: Configured no-restricted-imports in app/mobile/eslint.config.js to ensure the CI throws an error if any file under src/ or app/ tries to import from tests/fixtures/.