From 709990c161d004fbbebc6e84d1b485b4e3fd614a Mon Sep 17 00:00:00 2001 From: m-tartari <37861893+m-tartari@users.noreply.github.com> Date: Thu, 3 Jul 2025 11:57:01 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=85=20test(home):=20update=20unit=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit now the desktop and mobile version of the projects are a single component --- .../pages/MainPage/MainPage.test.tsx | 25 ++++--------------- 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/src/components/pages/MainPage/MainPage.test.tsx b/src/components/pages/MainPage/MainPage.test.tsx index ac87bdb..89cd7d1 100644 --- a/src/components/pages/MainPage/MainPage.test.tsx +++ b/src/components/pages/MainPage/MainPage.test.tsx @@ -18,25 +18,10 @@ describe('Main page', () => { // Make sure the page title is correct expect(screen.getByText('Robotics Engineer')).toBeInTheDocument() - // Make sure the project spotlights are present - expect(screen.getByText('LINFA: An Intuitive Block-Programming Interface for Reconfigurable Robots')).toBeInTheDocument() - expect(screen.getByText("Revamping HHCM's Modular: Swift Generation of Modular Robot Models")).toBeInTheDocument() - expect(screen.getByText('Automated Actuators and Robotic Modules Calibration')).toBeInTheDocument() - expect(screen.getByText('Voice Controlled Mobile Robot for Indoor Applications')).toBeInTheDocument() - }) - it('Should render the page correctly on mobile', async () => { - // Set the window size to mobile (Galaxy Note 20 Android 11) - window.innerWidth = 412 - window.innerHeight = 915 - await render() - - // Make sure the page title is correct - expect(screen.getByText('Robotics Engineer')).toBeInTheDocument() - - // Make sure the project spotlights are present - expect(screen.getByText('LINFA: An Intuitive Block-Programming Interface for Reconfigurable Robots')).toBeInTheDocument() - expect(screen.getByText("Revamping HHCM's Modular: Swift Generation of Modular Robot Models")).toBeInTheDocument() - expect(screen.getByText('Automated Actuators and Robotic Modules Calibration')).toBeInTheDocument() - expect(screen.getByText('Voice Controlled Mobile Robot for Indoor Applications')).toBeInTheDocument() + // Make sure the project spotlights are present for both desktop and mobile + expect(screen.getAllByText('LINFA: An Intuitive Block-Programming Interface for Reconfigurable Robots')).toHaveLength(2) + expect(screen.getAllByText("Revamping HHCM's Modular: Swift Generation of Modular Robot Models")).toHaveLength(2) + expect(screen.getAllByText('Automated Actuators and Robotic Modules Calibration')).toHaveLength(2) + expect(screen.getAllByText('Voice Controlled Mobile Robot for Indoor Applications')).toHaveLength(2) }) })