diff --git a/client/src/components/seo/index.tsx b/client/src/components/seo/index.tsx index 6ff5d4a2325..d3821db8499 100644 --- a/client/src/components/seo/index.tsx +++ b/client/src/components/seo/index.tsx @@ -73,7 +73,7 @@ const SEO: React.FC = ({ title, children }) => { const superBlockIntroObj: { title: string; intro: string[]; - } = t(`intro:${superBlock}`); + } = t(`intro:${superBlock}`, { returnObjects: true }); const { title: i18nTitle, intro: introText } = superBlockIntroObj; diff --git a/e2e/mobile/mobile-learn.spec.ts b/e2e/mobile/mobile-learn.spec.ts index 9066b62a8a1..bcd872588af 100644 --- a/e2e/mobile/mobile-learn.spec.ts +++ b/e2e/mobile/mobile-learn.spec.ts @@ -31,7 +31,22 @@ const publicSB = orderedSuperBlockInfo .filter(sb => sb.public === true && !nonEditorSB.includes(sb.dashedName)) .map(sb => sb.dashedName); -const typedCurriculum = currData as Curriculum; +const incompatible = [ + 'certifications', + 'a2-english-for-developers', + 'b1-english-for-developers' +]; + +const removeNonCompatibleSuperblocks = (currData: Curriculum): Curriculum => { + const copy = currData; + + for (const superBlock of incompatible) { + delete copy[superBlock]; + } + return copy; +}; + +const typedCurriculum = removeNonCompatibleSuperblocks(currData as never); test.describe('Test challenges in mobile', () => { for (const superBlock of publicSB) { diff --git a/e2e/seo.spec.ts b/e2e/seo.spec.ts index 35450b93980..d968b896393 100644 --- a/e2e/seo.spec.ts +++ b/e2e/seo.spec.ts @@ -3,6 +3,12 @@ import { SuperBlocks } from '../shared/config/superblocks'; import type { ListItem } from '../client/src/components/seo/'; import metaTags from '../client/i18n/locales/english/meta-tags.json'; +interface StructuredData { + '@context': string; + '@type': string; + itemListElement: ListItem[]; +} + test.beforeEach(async ({ page }) => { await page.goto('/'); }); @@ -20,7 +26,7 @@ test('should inject structured data (JSON-LD) into the page', async ({ expect(structuredData).toBeTruthy(); - const parsedData = JSON.parse(structuredData ?? ''); + const parsedData = JSON.parse(structuredData ?? '') as StructuredData; expect(parsedData?.['@context']).toBe('https://schema.org'); expect(parsedData['@type']).toBe('ItemList'); diff --git a/tsconfig.json b/tsconfig.json index fa6725f9fdc..bd29af2a986 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,7 @@ { "include": [ "curriculum/*.test.ts", + "e2e/**/*.ts", "tools/challenge-auditor/index.ts", "tools/challenge-editor/**/*", "tools/challenge-helper-scripts/**/*.ts",