mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
refactor(e2e): test urls can have trailing slashes (#58283)
This commit is contained in:
committed by
GitHub
parent
4eef3854c7
commit
8a852719f1
@@ -1,4 +1,5 @@
|
||||
import { test, expect } from '@playwright/test';
|
||||
import { allowTrailingSlash } from './utils/url';
|
||||
|
||||
// To run this test locally you will need to run: pnpm run start-ci;
|
||||
// Also, make sure that you have pm2 installed globally via: pnpm install -g pm2
|
||||
@@ -74,7 +75,7 @@ test.describe('Legacy Challenge Path Redirection Tests', () => {
|
||||
for (const [input, expected] of pathsToTest) {
|
||||
test(`should redirect from ${input} to ${expected}`, async ({ page }) => {
|
||||
await page.goto(input);
|
||||
await expect(page).toHaveURL(new RegExp(`${expected}/?`));
|
||||
await expect(page).toHaveURL(allowTrailingSlash(expected));
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user