File tree Expand file tree Collapse file tree 2 files changed +19
-3
lines changed Expand file tree Collapse file tree 2 files changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -22,3 +22,4 @@ dist-ssr
2222* .njsproj
2323* .sln
2424* .sw ?
25+ tests /__screenshots__ /
Original file line number Diff line number Diff line change 1- import { expect , test } from "vitest" ;
1+ import { beforeEach , expect , test } from "vitest" ;
22import { render } from "vitest-browser-react" ;
33import App from "../src/app" ;
44import { 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 ( / e o A P I - s t a c / i) ) . toBeVisible ( ) ;
29+ await expect . element ( app . getByText ( / c o l l e c t i o n s / i) ) . toBeVisible ( ) ;
30+ } ) ;
You can’t perform that action at this time.
0 commit comments