-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
350 create component test for satellitestatstablerow (#388)
* test(frontend): 🧪 add unfinished test for SatelliteStatsTableRow * feat(frontend): ✨ Add the new server url for testing * test(frontend): ✅ make statstablerow test * refactor(frontend): 🔥 remove test file for satelliteselector satelliteselector will not be tested --------- Co-authored-by: Jakob Grøtan Gregusson <jakobgg@stud.ntnu.no>
- Loading branch information
2 people
authored and
GitHub
committed
Apr 29, 2024
1 parent
76dd691
commit aaa0b9e
Showing
3 changed files
with
24 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
24 changes: 24 additions & 0 deletions
24
frontend/tests/componentTests/satelliteStatsTableRow.spec.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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( | ||
| <SatelliteStatsTableRow | ||
| satName={mockSatellite.name} | ||
| handleRowClick={() => {}} | ||
| />, | ||
| ); | ||
|
|
||
| await expect(component).toContainText("Satellite Name"); | ||
|
|
||
| // Click the row | ||
| await component.click(); | ||
| }); |