mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2025-12-19 18:18:27 -05:00
fix: landing tests (#61360)
This commit is contained in:
@@ -71,48 +71,54 @@ test.describe('Landing Top - Variation B', () => {
|
||||
});
|
||||
});
|
||||
|
||||
test.describe('Landing Top - Variation A', () => {
|
||||
test.beforeEach(async ({ context, page }) => {
|
||||
await addGrowthbookCookie({ context, variation: 'newA' });
|
||||
await goToLandingPage(page);
|
||||
});
|
||||
/*
|
||||
*
|
||||
* not currently in use after https://github.com/freeCodeCamp/freeCodeCamp/pull/61359
|
||||
* bring back after we fix GB
|
||||
*/
|
||||
|
||||
test('The headline renders correctly', async ({ page }) => {
|
||||
const landingHeading1 = page.getByTestId('landing-big-heading-1');
|
||||
await expect(landingHeading1).toHaveText(
|
||||
translations.landing['big-heading-1']
|
||||
);
|
||||
// test.describe('Landing Top - Variation A', () => {
|
||||
// test.beforeEach(async ({ context, page }) => {
|
||||
// await addGrowthbookCookie({ context, variation: 'newA' });
|
||||
// await goToLandingPage(page);
|
||||
// });
|
||||
|
||||
const landingHeading2 = page.getByTestId('landing-big-heading-2');
|
||||
await expect(landingHeading2).toHaveText(
|
||||
translations.landing['big-heading-2']
|
||||
);
|
||||
// test('The headline renders correctly', async ({ page }) => {
|
||||
// const landingHeading1 = page.getByTestId('landing-big-heading-1');
|
||||
// await expect(landingHeading1).toHaveText(
|
||||
// translations.landing['big-heading-1']
|
||||
// );
|
||||
|
||||
const landingHeading3 = page.getByTestId('landing-big-heading-3');
|
||||
await expect(landingHeading3).toHaveText(
|
||||
translations.landing['big-heading-3']
|
||||
);
|
||||
});
|
||||
// const landingHeading2 = page.getByTestId('landing-big-heading-2');
|
||||
// await expect(landingHeading2).toHaveText(
|
||||
// translations.landing['big-heading-2']
|
||||
// );
|
||||
|
||||
test('Logo row copy renders correctly', async ({ page }) => {
|
||||
const landingH2Heading = page.getByTestId('h2-heading');
|
||||
await expect(landingH2Heading).toHaveText(
|
||||
translations.landing['h2-heading'].replace(/<\/?strong>/g, '')
|
||||
);
|
||||
});
|
||||
// const landingHeading3 = page.getByTestId('landing-big-heading-3');
|
||||
// await expect(landingHeading3).toHaveText(
|
||||
// translations.landing['big-heading-3']
|
||||
// );
|
||||
// });
|
||||
|
||||
test('Hero image should have a description', async ({ isMobile, page }) => {
|
||||
const captionText = page.getByText(
|
||||
translations.landing['hero-img-description']
|
||||
);
|
||||
// test('Logo row copy renders correctly', async ({ page }) => {
|
||||
// const landingH2Heading = page.getByTestId('h2-heading');
|
||||
// await expect(landingH2Heading).toHaveText(
|
||||
// translations.landing['h2-heading'].replace(/<\/?strong>/g, '')
|
||||
// );
|
||||
// });
|
||||
|
||||
if (isMobile) {
|
||||
await expect(captionText).toBeHidden();
|
||||
} else {
|
||||
await expect(captionText).toBeVisible();
|
||||
}
|
||||
});
|
||||
});
|
||||
// test('Hero image should have a description', async ({ isMobile, page }) => {
|
||||
// const captionText = page.getByText(
|
||||
// translations.landing['hero-img-description']
|
||||
// );
|
||||
|
||||
// if (isMobile) {
|
||||
// await expect(captionText).toBeHidden();
|
||||
// } else {
|
||||
// await expect(captionText).toBeVisible();
|
||||
// }
|
||||
// });
|
||||
// });
|
||||
|
||||
test.describe('Landing Page', () => {
|
||||
test.beforeEach(async ({ page }) => {
|
||||
|
||||
Reference in New Issue
Block a user