|
1 | | -import { describe, expect, test } from "vitest"; |
| 1 | +import { describe, test } from "vitest"; |
2 | 2 | import { render } from "vitest-browser-react"; |
3 | 3 | import App from "../src/app"; |
4 | 4 | import { Provider } from "../src/components/ui/provider"; |
5 | 5 |
|
6 | | -function renderApp(path?: string) { |
7 | | - window.history.pushState({}, "", path || ""); |
| 6 | +function renderApp() { |
8 | 7 | return render( |
9 | 8 | <Provider> |
10 | 9 | <App></App> |
11 | 10 | </Provider>, |
12 | 11 | ); |
13 | 12 | } |
14 | 13 |
|
15 | | -describe("initial state", () => { |
16 | | - test("renders example button", async () => { |
17 | | - const app = renderApp(); |
18 | | - await expect |
19 | | - .element(app.getByRole("button", { name: "examples" })) |
20 | | - .toBeVisible(); |
21 | | - }); |
22 | | -}); |
23 | | - |
24 | | -describe("loading", () => { |
25 | | - test("stac.eoapi.dev", async () => { |
26 | | - const app = renderApp("?href=https://stac.eoapi.dev/"); |
27 | | - await expect.element(app.getByText(/eoAPI-stac/i)).toBeVisible(); |
28 | | - await expect.element(app.getByText(/collections/i)).toBeVisible(); |
29 | | - |
30 | | - await app.getByRole("heading", { name: "Afghanistan Earthquake" }).click(); |
31 | | - expect(new URL(window.location.href).search).toBe( |
32 | | - "?href=https://stac.eoapi.dev/collections/MAXAR_afghanistan_earthquake22", |
33 | | - ); |
34 | | - }); |
35 | | - |
36 | | - test("CSDA Planet", async () => { |
37 | | - // https://github.com/developmentseed/stac-map/issues/96 |
38 | | - const app = renderApp( |
39 | | - "?href=https://csdap.earthdata.nasa.gov/stac/collections/planet", |
40 | | - ); |
41 | | - await expect |
42 | | - .element(app.getByRole("heading", { name: "Planet" })) |
43 | | - .toBeVisible(); |
44 | | - }); |
45 | | - |
46 | | - test("NAIP stac-geoparquet", async () => { |
47 | | - const app = renderApp( |
48 | | - "?href=https://raw.githubusercontent.com/developmentseed/labs-375-stac-geoparquet-backend/refs/heads/main/data/naip.parquet", |
49 | | - ); |
50 | | - await expect.element(app.getByText(/stac-geoparquet/i)).toBeVisible(); |
51 | | - }); |
52 | | -}); |
53 | | - |
54 | 14 | describe("navigation", () => { |
55 | 15 | test("static catalog", async () => { |
56 | 16 | const app = renderApp(); |
|
0 commit comments