mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2025-12-19 18:18:27 -05:00
fix(client): fix daily challenge left breadcrumb (#63523)
This commit is contained in:
@@ -23,7 +23,7 @@ function DailyChallengeBreadCrumb({
|
|||||||
>
|
>
|
||||||
<ol data-playwright-test-label='breadcrumb-desktop'>
|
<ol data-playwright-test-label='breadcrumb-desktop'>
|
||||||
<li className='breadcrumb-left'>
|
<li className='breadcrumb-left'>
|
||||||
<Link to={`/learn`}>
|
<Link to={`/learn/daily-coding-challenge/archive`}>
|
||||||
<span>{i18next.t(`intro:daily-coding-challenge.title`)}</span>
|
<span>{i18next.t(`intro:daily-coding-challenge.title`)}</span>
|
||||||
</Link>
|
</Link>
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
import { test, expect } from '@playwright/test';
|
import { test, expect } from '@playwright/test';
|
||||||
import {
|
import {
|
||||||
getTodayUsCentral,
|
getTodayUsCentral,
|
||||||
formatDate
|
formatDate,
|
||||||
|
formatDisplayDate
|
||||||
} from '../client/src/components/daily-coding-challenge/helpers';
|
} from '../client/src/components/daily-coding-challenge/helpers';
|
||||||
|
|
||||||
const dateRouteRe = /.*\/daily-coding-challenge\/date\/.*/;
|
const dateRouteRe = /.*\/daily-coding-challenge\/date\/.*/;
|
||||||
@@ -134,6 +135,24 @@ test.describe('Daily Coding Challenges', () => {
|
|||||||
|
|
||||||
await page.goto(`/learn/daily-coding-challenge/${todayUsCentral}`);
|
await page.goto(`/learn/daily-coding-challenge/${todayUsCentral}`);
|
||||||
|
|
||||||
|
const leftBreadcrumb = page.getByRole('link', {
|
||||||
|
name: /daily coding challenge/i
|
||||||
|
});
|
||||||
|
await expect(leftBreadcrumb).toBeVisible();
|
||||||
|
await expect(leftBreadcrumb).toHaveAttribute(
|
||||||
|
'href',
|
||||||
|
'/learn/daily-coding-challenge/archive'
|
||||||
|
);
|
||||||
|
|
||||||
|
const rightBreadcrumb = page.getByRole('link', {
|
||||||
|
name: `${formatDisplayDate(todayUsCentral)}`
|
||||||
|
});
|
||||||
|
await expect(rightBreadcrumb).toBeVisible();
|
||||||
|
await expect(rightBreadcrumb).toHaveAttribute(
|
||||||
|
'href',
|
||||||
|
'/learn/daily-coding-challenge/archive'
|
||||||
|
);
|
||||||
|
|
||||||
await expect(page.getByText('Test title')).toBeVisible();
|
await expect(page.getByText('Test title')).toBeVisible();
|
||||||
|
|
||||||
await expect(page.getByText('Test description')).toBeVisible();
|
await expect(page.getByText('Test description')).toBeVisible();
|
||||||
|
|||||||
Reference in New Issue
Block a user