mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
fix(client): daily-coding-challenge routing (#65942)
Co-authored-by: moT01 <20648924+moT01@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
4974310729
commit
10d160b360
@@ -66,11 +66,9 @@ const mockApiAllChallenges = [
|
||||
const mockDaysInMonth = new Date(year, month, 0).getDate();
|
||||
|
||||
test.describe('Daily Coding Challenges', () => {
|
||||
test('should show not found page for invalid date', async ({ page }) => {
|
||||
test('should redirect to archive for invalid date', async ({ page }) => {
|
||||
await page.goto('/learn/daily-coding-challenge/invalid-date');
|
||||
await expect(
|
||||
page.getByText(/daily coding challenge not found\./i)
|
||||
).toBeVisible();
|
||||
await expect(page).toHaveURL('/learn/daily-coding-challenge/archive');
|
||||
});
|
||||
|
||||
test('should show not found page for date without challenge', async ({
|
||||
@@ -252,5 +250,10 @@ test.describe('Daily Coding Challenge Archive', () => {
|
||||
await expect(page.getByTestId('calendar-day-completed')).toHaveCount(1);
|
||||
|
||||
await expect(page.getByTestId('calendar-day-not-completed')).toHaveCount(3);
|
||||
|
||||
await page.getByTestId('calendar-day-completed').click();
|
||||
await expect(page).toHaveURL(
|
||||
`/learn/daily-coding-challenge/${todayUsCentral}`
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user