From 9f39f870cbf5c8a9d8ae5adc118b73b7c885613f Mon Sep 17 00:00:00 2001 From: m-tartari <37861893+m-tartari@users.noreply.github.com> Date: Mon, 16 Jun 2025 14:24:08 +0000 Subject: [PATCH] =?UTF-8?q?=E2=9C=85=20test(Curriculum):=20fix=20failing?= =?UTF-8?q?=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/CurriculumPage/CurriculumPage.test.tsx | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/components/pages/CurriculumPage/CurriculumPage.test.tsx b/src/components/pages/CurriculumPage/CurriculumPage.test.tsx index c386ff4..9ca1e00 100644 --- a/src/components/pages/CurriculumPage/CurriculumPage.test.tsx +++ b/src/components/pages/CurriculumPage/CurriculumPage.test.tsx @@ -38,10 +38,15 @@ describe('Curriculum component', () => { expect(screen.getByText('Education')).toBeInTheDocument() // check the subsections links - await userEvent.click(screen.getByText('EMARO+ Program - Master Studies')) - expect(open).toHaveBeenCalledWith('https://master-emaro.ec-nantes.fr/', '_blank') - await userEvent.click(screen.getByText('Almatong Project - Bachelor Studies')) - expect(open).toHaveBeenCalledWith('https://corsi.unibo.it/2cycle/AutomationEngineering/almatong-bachelor-programme', '_blank') + let link = screen.getByText('EMARO+ Program - Master Studies') + expect(link).toHaveAttribute('href', 'https://master-emaro.ec-nantes.fr/') + expect(link).toHaveAttribute('rel', 'noopener noreferrer') + expect(link).toHaveAttribute('target', '_blank') + + link = screen.getByText('Almatong Project - Bachelor Studies') + expect(link).toHaveAttribute('href', 'https://corsi.unibo.it/2cycle/AutomationEngineering/almatong-bachelor-programme') + expect(link).toHaveAttribute('rel', 'noopener noreferrer') + expect(link).toHaveAttribute('target', '_blank') // check some of the entries expect(screen.getAllByText('M.Eng. in Robotics and Control')).toHaveLength(2) // large and smallscreen versions