Skip to content

Commit 9c5bb22

Browse files
authored
Merge pull request #97543 from wildan-m/wildan/94530-upgrade-flow-currency-not-found
Allow the workspace currency selector to open from the upgrade step and travel confirmation
2 parents 9f25271 + e802dbd commit 9c5bb22

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import {DYNAMIC_ROUTES} from '@src/ROUTES';
2+
import SCREENS from '@src/SCREENS';
3+
4+
/**
5+
* The confirm workspace form always renders the currency row, and that row opens the `currency`
6+
* dynamic route appended to whichever screen is hosting the form. A host missing from
7+
* `entryScreens` fails validation in getStateFromPath, so the user lands on Not Found instead of
8+
* the currency selector. Regression guard for #94530.
9+
*/
10+
describe('WORKSPACE_CONFIRMATION_CURRENCY', () => {
11+
const currencyEntryScreens: readonly string[] = DYNAMIC_ROUTES.WORKSPACE_CONFIRMATION_CURRENCY.entryScreens;
12+
13+
it('allows opening the currency selector from every screen that hosts the confirm workspace form', () => {
14+
expect(currencyEntryScreens).toEqual(
15+
expect.arrayContaining([SCREENS.WORKSPACE_CONFIRMATION.DYNAMIC_ROOT, SCREENS.TRAVEL.WORKSPACE_CONFIRMATION, SCREENS.MONEY_REQUEST.STEP_UPGRADE]),
16+
);
17+
});
18+
19+
it('allows every host that the plan type row allows', () => {
20+
// Both rows sit on the same form, and the currency row is the one that renders for every
21+
// user, so any screen that can open the plan type selector must be able to open this one.
22+
const planTypeEntryScreens: readonly string[] = DYNAMIC_ROUTES.WORKSPACE_CONFIRMATION_PLAN_TYPE.entryScreens;
23+
expect(currencyEntryScreens).toEqual(expect.arrayContaining([...planTypeEntryScreens]));
24+
});
25+
});

0 commit comments

Comments
 (0)