-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Closed
Closed
Copy link
Labels
Awaiting PaymentAuto-added when associated PR is deployed to productionAuto-added when associated PR is deployed to productionInternalRequires API changes or must be handled by Expensify staffRequires API changes or must be handled by Expensify staffWeeklyKSv2KSv2
Description
Description
Current State:
- No tests for dynamic routing functionality
- Existing navigation tests may not cover suffix-based routing
Expected State:
- Comprehensive unit tests for all dynamic routing functions
- Tests should cover happy paths and edge cases
- Tests should validate access control behavior
Test Categories
1. createDynamicRoute() Tests
describe('createDynamicRoute', () => {
it('should append suffix to simple path');
it('should preserve query parameters');
it('should throw for invalid suffix');
it('should throw when current screen not in entryScreens');
});2. isDynamicRouteSuffix() Tests
describe('isDynamicRouteSuffix', () => {
it('should return true for valid dynamic suffix');
it('should return false for non-dynamic suffix');
it('should return false for empty string');
});3. Access Control Tests
describe('access control', () => {
it('should allow navigation from authorized screen');
it('should block navigation from unauthorized screen');
it('should validate on page refresh/deep link');
});4. getPathWithoutSuffix() Tests
describe('getPathWithoutSuffix', () => {
it('should strip suffix from path');
it('should preserve query params when stripping');
it('should return HOME for empty result');
});Scope
Files:
App/tests/unit/libs/Navigation/createDynamicRoute.test.ts(new)App/tests/unit/libs/Navigation/dynamicRouteHelpers.test.ts(new)App/tests/unit/libs/Navigation/getAdaptedStateFromPath.test.ts(existing or new)
Test Coverage:
createDynamicRoute()- URL generationisDynamicRouteSuffix()- Suffix detectiongetStateForDynamicRoute()- State building- Access control validation
getPathWithoutSuffix()- Back navigation helper
Dependencies:
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Awaiting PaymentAuto-added when associated PR is deployed to productionAuto-added when associated PR is deployed to productionInternalRequires API changes or must be handled by Expensify staffRequires API changes or must be handled by Expensify staffWeeklyKSv2KSv2