Skip to content

Commit

Permalink
Add redirect for /trademark to /legal/trademarks
Browse files Browse the repository at this point in the history
  • Loading branch information
NebraskaCoder committed May 3, 2024
1 parent 6071c1c commit f01e20f
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
11 changes: 10 additions & 1 deletion e2e/Redirects.spec.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
import { test } from "@playwright/test";
import { expectDownloadPage } from "./utils/PageUtils";
import {
expectDownloadPage,
expectTrademarkUsagePage,
} from "./utils/PageUtils";

test.describe("Website Redirects", () => {
test("redirects old /cloud-images to /download", async ({ page }) => {
await page.goto("/cloud-images");

await expectDownloadPage(page);
});
// /trademark redirects to /legal/trademarks
test("redirects old /trademark to /legal/trademarks", async ({ page }) => {
await page.goto("/trademark");

await expectTrademarkUsagePage(page);
});
});
5 changes: 5 additions & 0 deletions e2e/utils/PageUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,8 @@ export const expectDownloadPage = async (page: Page) => {
await expect(page).toHaveURL(/\/download/);
await expect(page).toHaveTitle(/Download - Rocky Linux/);
};

export const expectTrademarkUsagePage = async (page: Page) => {
await expect(page).toHaveURL(/\/legal\/trademarks/);
await expect(page).toHaveTitle(/Trademark Usage - Rocky Linux/);
};
5 changes: 5 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ const nextConfig = {
destination: "/download",
permanent: true,
},
{
source: "/trademark",
destination: "/legal/trademarks",
permanent: true,
},
];
},
};
Expand Down

0 comments on commit f01e20f

Please sign in to comment.