Skip to content

Commit

Permalink
350 create component test for satellitestatstablerow (#388)
Browse files Browse the repository at this point in the history
* 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
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ test("should work", async ({ mount }) => {
previewImage: "test",
slug: "test",
isProject: true,
// Add other required properties
};

const component = await mount(
Expand Down
2 changes: 0 additions & 2 deletions frontend/tests/componentTests/SatelliteSelector.spec.tsx

This file was deleted.

24 changes: 24 additions & 0 deletions frontend/tests/componentTests/satelliteStatsTableRow.spec.tsx
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();
});

0 comments on commit aaa0b9e

Please sign in to comment.