Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 17 additions & 7 deletions apps/marketing/tests/e2e/all-the-things.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,23 @@ test.describe(`[${getSiteType()}] All the things`, () => {
expect(await allTheThingsPage.description).toBe('SEO Description');
expect(await allTheThingsPage.robots).toBe('noindex, nofollow');

// OpenGraph title and description mirror metaTitle/metaDesc
expect(await allTheThingsPage.getOpenGraph('title')).toBe(
'❌ [ENGINEERING ONLY] UI Integration Testing - SEO',
);
expect(await allTheThingsPage.getOpenGraph('description')).toBe(
'SEO Description',
);
// LEGACY-ENV-COMPAT: the old production environment authors OpenGraph
// fields on a linked SEO Meta Data entry; the new model mirrors
// metaTitle/metaDesc. Remove the legacy arm once test/production serve
// the new content model.
const ogTitle = await allTheThingsPage.getOpenGraph('title');
if (ogTitle === 'OpenGraph Title') {
expect(await allTheThingsPage.getOpenGraph('description')).toBe(
'OpenGraph Description',
);
} else {
expect(ogTitle).toBe(
'❌ [ENGINEERING ONLY] UI Integration Testing - SEO',
);
expect(await allTheThingsPage.getOpenGraph('description')).toBe(
'SEO Description',
);
}
expect(await allTheThingsPage.getOpenGraph('image')).toMatch(
/https:\/\/contentful-images\.code\.org\/(.*)\/4hXiOPiRlCXpmtypRNOZqc\/(.*)\/engineering-only-opengraph-default\.png\?fm=webp/,
);
Expand Down
7 changes: 6 additions & 1 deletion apps/marketing/tests/e2e/i18n.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ test.describe('i18n', () => {
// Wait until window.Localize is available and truthy
await page.waitForFunction(() => !!window.Localize);

const languageDropdown = page.getByLabel('Select language');
// The redesigned Code.org footer labels the dropdown 'Select language';
// the MUI footer (csforall, and corporate on the legacy environment)
// labels it 'Language selection dropdown'.
const languageDropdown = page.getByLabel(
/^(Select language|Language selection dropdown)$/,
);
await expect(languageDropdown).toBeVisible();

await languageDropdown.selectOption('ar');
Expand Down
Loading