Skip to content

Commit a55d99b

Browse files
committed
update old route
1 parent 5cc4aa2 commit a55d99b

2 files changed

Lines changed: 19 additions & 2 deletions

File tree

src/libs/Navigation/linkingConfig/OldRoutes.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@ const oldRoutes: Record<string, string> = {
1717
'/workspaces/*/accounting/quickbooks-desktop/export/company-card-expense-account-select': '/workspaces/$1/accounting/quickbooks-desktop/export/qbd-company-card-expense-account-select',
1818
'/workspaces/*/accounting/quickbooks-desktop/export/company-card-expense-account/account-select':
1919
'/workspaces/$1/accounting/quickbooks-desktop/export/qbd-company-card-expense-account-select',
20-
'/workspaces/*/accounting/quickbooks-desktop/export/out-of-pocket-expense/account-select': '/workspaces/$1/accounting/quickbooks-desktop/export/out-of-pocket-expense/qbd-account-select',
21-
'/workspaces/*/accounting/quickbooks-desktop/export/out-of-pocket-expense/entity-select': '/workspaces/$1/accounting/quickbooks-desktop/export/out-of-pocket-expense/qbd-entity-select',
20+
'/workspaces/*/accounting/quickbooks-desktop/export/out-of-pocket-expense/account-select':
21+
'/workspaces/$1/accounting/quickbooks-desktop/export/qbd-out-of-pocket-expense/qbd-account-select',
22+
'/workspaces/*/accounting/quickbooks-desktop/export/out-of-pocket-expense/entity-select':
23+
'/workspaces/$1/accounting/quickbooks-desktop/export/qbd-out-of-pocket-expense/qbd-entity-select',
2224
'/flag/*/*': '/r/$1/flag/$1/$2',
2325
'/home-page': '/home',
2426
/* eslint-enable @typescript-eslint/naming-convention */

tests/navigation/getMatchingNewRouteTest.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,21 @@ describe('getBestMatchingPath', () => {
5050
);
5151
});
5252

53+
it('redirects old QuickBooks Desktop out-of-pocket selector paths to new dynamic routes', () => {
54+
expect(getMatchingNewRoute('/workspaces/p123/accounting/quickbooks-desktop/export/out-of-pocket-expense/account-select')).toBe(
55+
'/workspaces/p123/accounting/quickbooks-desktop/export/qbd-out-of-pocket-expense/qbd-account-select',
56+
);
57+
expect(getMatchingNewRoute('/workspaces/p123/accounting/quickbooks-desktop/export/out-of-pocket-expense/entity-select')).toBe(
58+
'/workspaces/p123/accounting/quickbooks-desktop/export/qbd-out-of-pocket-expense/qbd-entity-select',
59+
);
60+
});
61+
62+
it('preserves query params when redirecting old QuickBooks Desktop out-of-pocket selector paths', () => {
63+
expect(getMatchingNewRoute('/workspaces/p123/accounting/quickbooks-desktop/export/out-of-pocket-expense/entity-select?backTo=/home')).toBe(
64+
'/workspaces/p123/accounting/quickbooks-desktop/export/qbd-out-of-pocket-expense/qbd-entity-select?backTo=/home',
65+
);
66+
});
67+
5368
it('preserves query params when redirecting old NetSuite invoice item preference path', () => {
5469
expect(getMatchingNewRoute('/workspaces/abc/connections/netsuite/export/invoice-item-preference/invoice-item/select?backTo=/home')).toBe(
5570
'/workspaces/abc/connections/netsuite/export/invoice-item-preference/select/invoice-item/select?backTo=/home',

0 commit comments

Comments
 (0)