Skip to content

Commit 0fa2d29

Browse files
committed
test: add one more
1 parent 3810a0f commit 0fa2d29

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@ dist-ssr
2222
*.njsproj
2323
*.sln
2424
*.sw?
25+
tests/__screenshots__/

tests/app.spec.tsx

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,30 @@
1-
import { expect, test } from "vitest";
1+
import { beforeEach, expect, test } from "vitest";
22
import { render } from "vitest-browser-react";
33
import App from "../src/app";
44
import { Provider } from "../src/components/ui/provider";
55

6-
test("renders example button", async () => {
7-
const app = await render(
6+
async function renderApp() {
7+
return await render(
88
<Provider>
99
<App></App>
1010
</Provider>,
1111
);
12+
}
13+
14+
beforeEach(() => {
15+
window.history.pushState({}, "", "/");
16+
});
17+
18+
test("renders example button", async () => {
19+
const app = await renderApp();
1220
await expect
1321
.element(app.getByRole("button", { name: "examples" }))
1422
.toBeVisible();
1523
});
24+
25+
test("loads STAC API from eoapi.dev", async () => {
26+
window.history.pushState({}, "", "?href=https://stac.eoapi.dev/");
27+
const app = await renderApp();
28+
await expect.element(app.getByText(/eoAPI-stac/i)).toBeVisible();
29+
await expect.element(app.getByText(/collections/i)).toBeVisible();
30+
});

0 commit comments

Comments
 (0)