diff --git a/test/unit/get-startedPage.test.js b/test/unit/get-startedPage.test.js index 54a00569..7f91c688 100644 --- a/test/unit/get-startedPage.test.js +++ b/test/unit/get-startedPage.test.js @@ -25,7 +25,7 @@ describe(`Get Started Page (seed: ${seed})`, () => { it('Renders the correct headings', () => { expect(document.querySelector('span.govuk-caption-xl').textContent).toEqual(params.organisation.name) expect(document.querySelector('h1').textContent).toContain(`${params.dataset.name}`) - expect(document.querySelector('h2').textContent).toContain(`How to prepare and submit your ${params.dataset.name} data`) + expect(document.querySelector('#main-content h2').textContent).toContain(`How to prepare and submit your ${params.dataset.name} data`) }) it('Renders breadcrumbs correctly', () => { diff --git a/test/unit/http-errorPage.test.js b/test/unit/http-errorPage.test.js index 83c23831..419beb04 100644 --- a/test/unit/http-errorPage.test.js +++ b/test/unit/http-errorPage.test.js @@ -23,7 +23,7 @@ describe(`http-error.html(seed: ${seed})`, () => { }) it('Renders the correct heading', () => { - expect(document.querySelector('h2').textContent).toContain('Error accessing data URL') + expect(document.querySelector('#main-content h2').textContent).toContain('Error accessing data URL') }) it('Renders the error details summary list', () => { diff --git a/test/unit/views/organisations/dataset-overview.test.js b/test/unit/views/organisations/dataset-overview.test.js index bbb5c1bb..0555a8c4 100644 --- a/test/unit/views/organisations/dataset-overview.test.js +++ b/test/unit/views/organisations/dataset-overview.test.js @@ -70,7 +70,7 @@ describe('Dataset Overview Page', () => { }) it('Renders dataset details correctly', () => { - expect(document.querySelector('h2.govuk-heading-m').textContent).toContain('Dataset details') + expect(document.querySelector('#main-content h2.govuk-heading-m').textContent).toContain('Dataset details') const summaryListValues = document.querySelectorAll('dd.govuk-summary-list__value') expect(summaryListValues[0].textContent.trim()).toEqual(params.stats.numberOfRecords.toString()) expect(summaryListValues[1].textContent.trim()).toEqual(`${params.stats.numberOfFieldsSupplied}/${params.stats.numberOfExpectedFields}`)