diff --git a/cypress/integration/tests/sitemap.cy.tsx b/cypress/integration/tests/sitemap.cy.tsx new file mode 100644 index 00000000..d2cce748 --- /dev/null +++ b/cypress/integration/tests/sitemap.cy.tsx @@ -0,0 +1,16 @@ +describe('Sitemap should have', () => { + const SITEMAP_URL = '/sitemap.xml'; + const BLOOM_URL = 'https://bloom.chayn.co'; + before(() => { + cy.cleanUpTestState(); + }); + + it('bloom url', () => { + cy.request(SITEMAP_URL).its('body').should('include', BLOOM_URL); + }); + it('meet the team url', () => { + cy.request(SITEMAP_URL) + .its('body') + .should('include', BLOOM_URL + '/meet-the-team'); + }); +}); diff --git a/pages/sitemap.xml.tsx b/pages/sitemap.xml.tsx index 8ee79cea..b1a51193 100644 --- a/pages/sitemap.xml.tsx +++ b/pages/sitemap.xml.tsx @@ -10,10 +10,7 @@ async function generateSiteMap({ locales }: any) { https://bloom.chayn.co - https://bloom.chayn.co/therapy/about-our-courses - - - https://bloom.chayn.co/therapy/meet-the-team + https://bloom.chayn.co/meet-the-team https://bloom.chayn.co/therapy/book-session @@ -22,10 +19,11 @@ async function generateSiteMap({ locales }: any) { https://bloom.chayn.co/therapy/confirmed-session ${courses - .map((course: any) => { + .map((course: { locale: string; params: { slug: string; sessionSlug: string } }) => { + const locale = course.locale !== 'en' ? `/${course.locale}` : ''; return ` - ${`https://bloom.chayn.co/courses/${course.params.slug}/${course.params.sessionSlug}`} + ${`https://bloom.chayn.co${locale}/courses/${course.params.slug}/${course.params.sessionSlug}`} `; })