From aaa0b9e88fc42e0bef9190778de55dede0bc0d67 Mon Sep 17 00:00:00 2001 From: Mats <64415243+mnyflot@users.noreply.github.com> Date: Mon, 29 Apr 2024 17:38:58 +0200 Subject: [PATCH] 350 create component test for satellitestatstablerow (#388) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * test(frontend): :test_tube: add unfinished test for SatelliteStatsTableRow * feat(frontend): :sparkles: Add the new server url for testing * test(frontend): :white_check_mark: make statstablerow test * refactor(frontend): :fire: remove test file for satelliteselector satelliteselector will not be tested --------- Co-authored-by: Jakob Grøtan Gregusson --- .../RelatedProjectAndSatellites.spec.tsx | 1 - .../componentTests/SatelliteSelector.spec.tsx | 2 -- .../satelliteStatsTableRow.spec.tsx | 24 +++++++++++++++++++ 3 files changed, 24 insertions(+), 3 deletions(-) delete mode 100644 frontend/tests/componentTests/SatelliteSelector.spec.tsx create mode 100644 frontend/tests/componentTests/satelliteStatsTableRow.spec.tsx diff --git a/frontend/tests/componentTests/RelatedProjectAndSatellites.spec.tsx b/frontend/tests/componentTests/RelatedProjectAndSatellites.spec.tsx index 4156926..c2bdec3 100644 --- a/frontend/tests/componentTests/RelatedProjectAndSatellites.spec.tsx +++ b/frontend/tests/componentTests/RelatedProjectAndSatellites.spec.tsx @@ -9,7 +9,6 @@ test("should work", async ({ mount }) => { previewImage: "test", slug: "test", isProject: true, - // Add other required properties }; const component = await mount( diff --git a/frontend/tests/componentTests/SatelliteSelector.spec.tsx b/frontend/tests/componentTests/SatelliteSelector.spec.tsx deleted file mode 100644 index 336646a..0000000 --- a/frontend/tests/componentTests/SatelliteSelector.spec.tsx +++ /dev/null @@ -1,2 +0,0 @@ -import SatelliteSelector from "@/components/homeComponents/SatelliteSelector"; -import { test, expect } from "@playwright/experimental-ct-react"; diff --git a/frontend/tests/componentTests/satelliteStatsTableRow.spec.tsx b/frontend/tests/componentTests/satelliteStatsTableRow.spec.tsx new file mode 100644 index 0000000..17a3a83 --- /dev/null +++ b/frontend/tests/componentTests/satelliteStatsTableRow.spec.tsx @@ -0,0 +1,24 @@ +import SatelliteStatsTableRow from "@/components/satelliteData/SatelliteStatsTableRow"; +import { test, expect } from "@playwright/experimental-ct-react"; + +// Mock satellite data +const mockSatellite = { + id: "satelliteId", + name: "Satellite Name", + previewImage: "Satellite Image", + slug: "SatelliteSlug", +}; + +test("should be clickable", async ({ mount }) => { + const component = await mount( + {}} + />, + ); + + await expect(component).toContainText("Satellite Name"); + + // Click the row + await component.click(); +});