Skip to content

Commit

Permalink
277 test for featured image (#293)
Browse files Browse the repository at this point in the history
* create desktop test for featured image

* test(frontend): ✅ add tests for featured image

* refactor: prettier write

* test(frontend): ✅ update featured image tests

---------

Co-authored-by: Mats <mnyflot@gmail.com>
  • Loading branch information
2 people authored and GitHub committed Apr 16, 2024
1 parent bbd41ff commit 0883596
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 14 deletions.
24 changes: 12 additions & 12 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
"@graphql-typed-document-node/core": "^3.2.0",
"@iconify-icon/react": "^2.0.1",
"@iconify/react": "^4.1.1",
"@playwright/test": "^1.41.2",
"@playwright/test": "^1.43.1",
"@tailwindcss/typography": "^0.5.10",
"@types/chart.js": "^2.9.41",
"@types/luxon": "^3.4.2",
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/lib/data/fetchFeaturedImage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export default async function fetchFeaturedImage() {
<div>
<div className="relative h-[300px] w-[300px]">
<Image
alt="Most recent satellite image"
alt="Featured satellite image"
src={featuredImageURL}
className="m-0"
layout="fill"
Expand Down
11 changes: 11 additions & 0 deletions frontend/tests/featured-image.desktop.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { test, expect } from "@playwright/test";

test("test", async ({ page }) => {
await page.goto("/");
await expect(
page.getByRole("img", { name: "Featured satellite image" }),
).toBeVisible();
await expect(
page.getByRole("heading", { name: "Featured Satellite Image" }),
).toBeVisible();
});
11 changes: 11 additions & 0 deletions frontend/tests/featured-image.mobile.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { test, expect } from "@playwright/test";

test("test", async ({ page }) => {
await page.goto("/");
await expect(
page.getByRole("img", { name: "Featured satellite image" }),
).toBeVisible();
await expect(
page.getByRole("heading", { name: "Featured Satellite Image" }),
).toBeVisible();
});

0 comments on commit 0883596

Please sign in to comment.