Skip to content

Commit

Permalink
EES-5633 Adding the /data-tables/{publication-slug} path back into …
Browse files Browse the repository at this point in the history
…the list of matched redirect URL Patterns
  • Loading branch information
jack-hive committed Dec 12, 2024
1 parent 4de8f78 commit 286e184
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,33 @@ describe('redirectPages', () => {
nonRedirectedCases: findStatisticsReleasePageTestData.nonRedirectedCases,
};

const dataTablesPublicationPageTestData: RoutePatternTestCases = {
routePattern: `data-tables/${publicationSlugPlaceholder}`,
redirectedCases: [
{
oldSlugNewSlugPairsByPlaceholder: {
[publicationSlugPlaceholder]: {
oldSlug: 'original-publication-slug-1',
newSlug: 'updated-publication-slug-1',
},
},
},
],
nonRedirectedCases: [
{
oldSlugsByPlaceholder: {
[publicationSlugPlaceholder]: 'original-publication-slug-2',
},
},
// Matches redirect slugs from another redirect type
{
oldSlugsByPlaceholder: {
[publicationSlugPlaceholder]: 'original-methodology-slug-1',
},
},
],
};

const dataTablesReleasePageTestData: RoutePatternTestCases = {
routePattern: `data-tables/${publicationSlugPlaceholder}/${releaseSlugPlaceholder}`,
redirectedCases: mixedPublicationReleasePageRedirectedCases,
Expand All @@ -313,6 +340,7 @@ describe('redirectPages', () => {
findStatisticsReleasePageTestData,
findStatisticsReleaseDataGuidancePageTestData,
findStatisticsReleasePrereleaseAccessListPageTestData,
dataTablesPublicationPageTestData,
dataTablesReleasePageTestData,
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ const redirectPatterns: URLPattern[] = [
new URLPattern({
pathname: `/find-statistics/:${publicationSlugKey}/:${releaseSlugKey}/(data-guidance/?|prerelease-access-list/?|.{0})?`,
}),
new URLPattern({
pathname: `/data-tables/:${publicationSlugKey}{/}?`,
}),
new URLPattern({
pathname: `/data-tables/:${publicationSlugKey}/:${releaseSlugKey}{/}?`,
}),
Expand Down

0 comments on commit 286e184

Please sign in to comment.