|
| 1 | +import isDynamicRouteScreen from '@libs/Navigation/helpers/dynamicRoutesUtils/isDynamicRouteScreen'; |
| 2 | +import type {Screen} from '@src/SCREENS'; |
| 3 | +import SCREENS from '@src/SCREENS'; |
| 4 | + |
| 5 | +describe('isDynamicRouteScreen', () => { |
| 6 | + it('should return true for a static dynamic route screen (DYNAMIC_VERIFY_ACCOUNT)', () => { |
| 7 | + expect(isDynamicRouteScreen(SCREENS.SETTINGS.DYNAMIC_VERIFY_ACCOUNT)).toBe(true); |
| 8 | + }); |
| 9 | + |
| 10 | + it('should return true for a multi-segment dynamic route screen (DYNAMIC_ADD_BANK_ACCOUNT_VERIFY_ACCOUNT)', () => { |
| 11 | + expect(isDynamicRouteScreen(SCREENS.SETTINGS.DYNAMIC_ADD_BANK_ACCOUNT_VERIFY_ACCOUNT)).toBe(true); |
| 12 | + }); |
| 13 | + |
| 14 | + it('should return true for a parametric dynamic route screen (DYNAMIC_FLAG_COMMENT)', () => { |
| 15 | + expect(isDynamicRouteScreen(SCREENS.DYNAMIC_FLAG_COMMENT)).toBe(true); |
| 16 | + }); |
| 17 | + |
| 18 | + it('should return true for DYNAMIC_KEYBOARD_SHORTCUTS', () => { |
| 19 | + expect(isDynamicRouteScreen(SCREENS.SETTINGS.DYNAMIC_KEYBOARD_SHORTCUTS)).toBe(true); |
| 20 | + }); |
| 21 | + |
| 22 | + it('should return true for DYNAMIC_ADDRESS_COUNTRY', () => { |
| 23 | + expect(isDynamicRouteScreen(SCREENS.SETTINGS.PROFILE.DYNAMIC_ADDRESS_COUNTRY)).toBe(true); |
| 24 | + }); |
| 25 | + |
| 26 | + it('should return false for a regular screen (HOME)', () => { |
| 27 | + expect(isDynamicRouteScreen(SCREENS.HOME)).toBe(false); |
| 28 | + }); |
| 29 | + |
| 30 | + it('should return false for a regular screen (REPORT)', () => { |
| 31 | + expect(isDynamicRouteScreen(SCREENS.REPORT)).toBe(false); |
| 32 | + }); |
| 33 | + |
| 34 | + it('should return false for a regular settings screen (Settings_Root)', () => { |
| 35 | + expect(isDynamicRouteScreen(SCREENS.SETTINGS.ROOT)).toBe(false); |
| 36 | + }); |
| 37 | + |
| 38 | + it('should return false for a screen name not present in normalizedConfigs', () => { |
| 39 | + expect(isDynamicRouteScreen('NonExistentScreen_12345' as Screen)).toBe(false); |
| 40 | + }); |
| 41 | +}); |
0 commit comments