Skip to content

Commit 534061a

Browse files
authored
Merge pull request #95368 from huult/83863-update-old-routes
[CP Staging] update old routes
2 parents 4b2a75e + c0a7854 commit 534061a

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

src/libs/Navigation/linkingConfig/OldRoutes.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ const oldRoutes: Record<string, string> = {
7979
'/workspaces/*/company-cards/*/refresh-card-feed-connection': '/workspaces/$1/company-cards/$2/refresh-card-feed-connection',
8080
'/workspaces/*/company-cards/*/work-email': '/workspaces/$1/company-cards/$2/work-email',
8181
'/workspaces/*/company-cards/*/verify-work-email': '/workspaces/$1/company-cards/$2/verify-work-email',
82+
'/workspaces/*/company-cards/settings/*': '/workspaces/$1/company-cards/settings/$2',
83+
'/workspaces/*/company-cards/add-card-feed/*': '/workspaces/$1/company-cards/add-card-feed/$2',
84+
'/workspaces/*/company-cards/select-feed/*': '/workspaces/$1/company-cards/select-feed/$2',
8285
'/workspaces/*/company-cards/*/*': '/workspaces/$1/company-cards/company-card-details/$2/$3',
8386
'/workspace/confirmation/currency': '/workspaces/workspace/confirmation/currency',
8487
'/workspace/confirmation': '/workspaces/workspace/confirmation',

tests/navigation/getMatchingNewRouteTest.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,21 @@ describe('getBestMatchingPath', () => {
302302
);
303303
});
304304

305+
it('does not rewrite workspace company card settings sub-pages', () => {
306+
expect(getMatchingNewRoute('/workspaces/p123/company-cards/settings/feed-name')).toBe('/workspaces/p123/company-cards/settings/feed-name');
307+
expect(getMatchingNewRoute('/workspaces/p123/company-cards/settings/statement-close-date')).toBe('/workspaces/p123/company-cards/settings/statement-close-date');
308+
});
309+
310+
it('does not rewrite workspace company card add-card-feed sub-pages', () => {
311+
expect(getMatchingNewRoute('/workspaces/p123/company-cards/add-card-feed/import')).toBe('/workspaces/p123/company-cards/add-card-feed/import');
312+
expect(getMatchingNewRoute('/workspaces/p123/company-cards/add-card-feed/import/mapping')).toBe('/workspaces/p123/company-cards/add-card-feed/import/mapping');
313+
expect(getMatchingNewRoute('/workspaces/p123/company-cards/add-card-feed/layout-name')).toBe('/workspaces/p123/company-cards/add-card-feed/layout-name');
314+
});
315+
316+
it('does not rewrite the add-card-feed flow opened from the select-feed screen', () => {
317+
expect(getMatchingNewRoute('/workspaces/p123/company-cards/select-feed/add-card-feed')).toBe('/workspaces/p123/company-cards/select-feed/add-card-feed');
318+
});
319+
305320
it('does not rewrite dynamic assign-card assignee paths', () => {
306321
expect(getMatchingNewRoute('/workspaces/D56D50B841F69B0E/company-cards/assign-card/oauth.mockbank.com%2322298108/Mock%20Credit%20Card%20-%201234/assignee')).toBe(
307322
'/workspaces/D56D50B841F69B0E/company-cards/assign-card/oauth.mockbank.com%2322298108/Mock%20Credit%20Card%20-%201234/assignee',

0 commit comments

Comments
 (0)