11import { describe , test , expect } from "vitest" ;
22import { render , waitFor } from "@testing-library/react" ;
3- import { TideGraph } from "../../src/components/TideGraph/index.js" ;
3+ import { TideGraphStatic } from "../../src/components/TideGraph/index.js" ;
44import { createTestWrapper } from "../helpers.js" ;
55
66const timeline = [
@@ -19,10 +19,10 @@ const extremes = [
1919 { time : new Date ( "2025-12-17T12:00:00Z" ) , level : 0.3 , high : false , low : true , label : "Low" } ,
2020] ;
2121
22- describe ( "TideGraph " , ( ) => {
23- test ( "renders a canvas element in data-driven mode " , async ( ) => {
22+ describe ( "TideGraphStatic " , ( ) => {
23+ test ( "renders an svg element" , async ( ) => {
2424 const { container } = render (
25- < TideGraph timeline = { timeline } extremes = { extremes } timezone = "UTC" units = "meters" /> ,
25+ < TideGraphStatic timeline = { timeline } extremes = { extremes } timezone = "UTC" units = "meters" /> ,
2626 { wrapper : createTestWrapper ( ) } ,
2727 ) ;
2828
@@ -32,9 +32,10 @@ describe("TideGraph", () => {
3232 } ) ;
3333
3434 test ( "renders with empty extremes" , async ( ) => {
35- const { container } = render ( < TideGraph timeline = { timeline } timezone = "UTC" units = "meters" /> , {
36- wrapper : createTestWrapper ( ) ,
37- } ) ;
35+ const { container } = render (
36+ < TideGraphStatic timeline = { timeline } timezone = "UTC" units = "meters" /> ,
37+ { wrapper : createTestWrapper ( ) } ,
38+ ) ;
3839
3940 await waitFor ( ( ) => {
4041 expect ( container . querySelector ( "svg" ) ) . not . toBeNull ( ) ;
@@ -43,7 +44,7 @@ describe("TideGraph", () => {
4344
4445 test ( "applies className" , ( ) => {
4546 const { container } = render (
46- < TideGraph timeline = { timeline } timezone = "UTC" units = "meters" className = "my-graph" /> ,
47+ < TideGraphStatic timeline = { timeline } timezone = "UTC" units = "meters" className = "my-graph" /> ,
4748 { wrapper : createTestWrapper ( ) } ,
4849 ) ;
4950
0 commit comments