diff --git a/e2e/tests/bedside-smoke.spec.js b/e2e/tests/bedside-smoke.spec.js index 3d20e3a..67604a4 100644 --- a/e2e/tests/bedside-smoke.spec.js +++ b/e2e/tests/bedside-smoke.spec.js @@ -129,10 +129,23 @@ test.describe('Bedside — dose calculators fire', () => { }); test.describe('Bedside — interactive widgets', () => { - test('Lightbox: View pathway image button opens modal', async ({ page }) => { + test('Lightbox: seizure pathway image opens and closes', async ({ page }) => { await openBedside(page, 'seizure'); await page.click('button[data-img-src="/img/epilepsy_eiic_pathway.png"]'); await expect(page.locator('#img-lightbox')).toBeVisible(); + await expect(page.locator('#img-lightbox-img')).toHaveAttribute('src', /epilepsy_eiic_pathway/); + await page.click('#img-lightbox-close'); + await expect(page.locator('#img-lightbox')).toBeHidden(); + }); + + test('Lightbox: NRP pathway image opens on neonatal sub-pill', async ({ page }) => { + await openBedside(page, 'neonatal'); + // The "View pathway image" button sits inside a collapsed
+ // titled "NRP Resuscitation Pathway" — expand it first. + await page.getByText('NRP Resuscitation Pathway').click(); + await page.click('button[data-img-src="/img/nrp_pathway.png"]'); + await expect(page.locator('#img-lightbox')).toBeVisible(); + await expect(page.locator('#img-lightbox-img')).toHaveAttribute('src', /nrp_pathway/); await page.click('#img-lightbox-close'); await expect(page.locator('#img-lightbox')).toBeHidden(); }); diff --git a/public/components/calculators.html b/public/components/calculators.html index 41f5f15..13b91b9 100644 --- a/public/components/calculators.html +++ b/public/components/calculators.html @@ -652,12 +652,7 @@ - - + + diff --git a/public/e2e-harness.html b/public/e2e-harness.html index fdd695b..6fc88b4 100644 --- a/public/e2e-harness.html +++ b/public/e2e-harness.html @@ -25,5 +25,16 @@ + + + diff --git a/public/index.html b/public/index.html index 271e216..9be9c25 100644 --- a/public/index.html +++ b/public/index.html @@ -470,5 +470,18 @@ + +