Skip to content

Commit

Permalink
test: for changing satellite prediction time (#449)
Browse files Browse the repository at this point in the history
  • Loading branch information
Thibault authored and GitHub committed Jun 16, 2025
1 parent 0189a95 commit 92b9870
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ export default function Map2d({ satNum }: { satNum: SatelliteNumber }) {
value={inputValue}
onChange={handleSliderChange}
className="w-full rounded-lg bg-gray-200 py-2 text-black focus:outline-none focus:ring"
data-testid="prediction-slider"
/>
<p className="mt-2 font-thin">
Projected positions {projectionAmount / 60} hours into
Expand Down
12 changes: 12 additions & 0 deletions frontend/tests/e2e/satellite.desktop.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { test, expect } from "@playwright/test";
import { Sliders } from "lucide-react";

test.describe("All Satellites Page Test", () => {
test("CheckHeadingAndSubtitleIsVisible", async ({ page }) => {
Expand Down Expand Up @@ -31,4 +32,15 @@ test.describe("Individual Satellite Page Test", () => {
await expect(page.getByRole("heading").nth(2)).toBeVisible();
await expect(page.getByTestId("blockParagraph").first()).toBeVisible();
});

test("TestChangingPredictionTime", async ({ page }) => {
await page.goto("/");
await page.getByRole("button", { name: "Satellites" }).click();
await page.getByTestId("satellitesTableRow").first().click();
await expect(page).toHaveURL(/\/satellites\/.+$/);
const slider = page.getByTestId("prediction-slider");
await expect(slider).toHaveValue("120");
await slider.fill("180"); //Prediction of position in 180 minutes
await expect(slider).toHaveValue("180");
});
});
11 changes: 11 additions & 0 deletions frontend/tests/e2e/satellite.mobile.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,15 @@ test.describe("Individual Satellite Page Test", () => {
await expect(page.getByRole("heading").nth(2)).toBeVisible();
await expect(page.getByTestId("blockParagraph").first()).toBeVisible();
});

test("TestChangingPredictionTime", async ({ page }) => {
await page.goto("/");
await page.getByRole("button", { name: "Satellites" }).click();
await page.getByTestId("satellitesTableRow").first().click();
await expect(page).toHaveURL(/\/satellites\/.+$/);
const slider = page.getByTestId("prediction-slider");
await expect(slider).toHaveValue("120");
await slider.fill("180"); //Prediction of position in 180 minutes
await expect(slider).toHaveValue("180");
});
});

0 comments on commit 92b9870

Please sign in to comment.