1- import { describe , it , expect , beforeEach } from ' vitest' ;
1+ import { describe , it , expect , beforeEach } from " vitest" ;
22
3- describe ( ' 1. Start Here' , ( ) => {
3+ describe ( " 1. Start Here" , ( ) => {
44 let viewer ;
55
66 beforeEach ( ( ) => {
77 // Setup the DOM as per the Quick Start example
8- document . body . innerHTML = '<div id="waymark-map" style="height: 500px; width: 500px;"></div>' ;
9-
8+ document . body . innerHTML =
9+ '<div id="waymark-map" style="height: 500px; width: 500px;"></div>' ;
10+
1011 // Mock clientHeight/clientWidth for Leaflet
11- const container = document . getElementById ( ' waymark-map' ) ;
12- Object . defineProperty ( container , ' clientWidth' , { value : 500 } ) ;
13- Object . defineProperty ( container , ' clientHeight' , { value : 500 } ) ;
12+ const container = document . getElementById ( " waymark-map" ) ;
13+ Object . defineProperty ( container , " clientWidth" , { value : 500 } ) ;
14+ Object . defineProperty ( container , " clientHeight" , { value : 500 } ) ;
1415 } ) ;
1516
16- describe ( ' Quick Start' , ( ) => {
17- it ( ' should initialize a map with custom marker and load GeoJSON' , ( ) => {
17+ describe ( " Quick Start" , ( ) => {
18+ it ( " should initialize a map with custom marker and load GeoJSON" , ( ) => {
1819 // Create viewer Instance
1920 viewer = window . Waymark_Map_Factory . viewer ( ) ;
2021
@@ -23,7 +24,7 @@ describe('1. Start Here', () => {
2324 map_options : {
2425 // Initial Map Zoom
2526 map_init_zoom : 16 ,
26- map_div_id : ' waymark-map' , // Explicitly set ID for test environment safety
27+ map_div_id : " waymark-map" , // Explicitly set ID for test environment safety
2728
2829 // Our Pub Icon
2930 marker_types : [
@@ -38,12 +39,12 @@ describe('1. Start Here', () => {
3839 } ) ;
3940
4041 // Verify map is initialized
41- const mapContainer = document . getElementById ( ' waymark-map' ) ;
42- expect ( mapContainer . classList . contains ( ' leaflet-container' ) ) . toBe ( true ) ;
43-
42+ const mapContainer = document . getElementById ( " waymark-map" ) ;
43+ expect ( mapContainer . classList . contains ( " leaflet-container" ) ) . toBe ( true ) ;
44+
4445 // Verify init_done() was called (which adds this class)
4546 // This ensures the map is fully initialized and visible
46- expect ( mapContainer . classList . contains ( ' waymark-is-viewer' ) ) . toBe ( true ) ;
47+ expect ( mapContainer . classList . contains ( " waymark-is-viewer" ) ) . toBe ( true ) ;
4748
4849 // Load GeoJSON
4950 viewer . load_json ( {
@@ -56,7 +57,8 @@ describe('1. Start Here', () => {
5657 title : "The Scarlet Ibis" ,
5758 description :
5859 "Great pub, great food! Especially after a Long Ride 🚴🍔🍟🍺🍺💤" ,
59- image_large_url : "https://www.waymark.dev/assets/geo/pub.jpeg" ,
60+ image_large_url :
61+ "https://www.ogis.org/waymark-js/assets/geo/pub.jpeg" ,
6062 } ,
6163 geometry : {
6264 type : "Point" ,
@@ -69,7 +71,7 @@ describe('1. Start Here', () => {
6971 // Verify marker is added to the map
7072 // We can check if a marker icon with the expected class exists
7173 // Note: Waymark likely adds classes based on the icon type
72- const markers = document . querySelectorAll ( ' .leaflet-marker-icon' ) ;
74+ const markers = document . querySelectorAll ( " .leaflet-marker-icon" ) ;
7375 expect ( markers . length ) . toBeGreaterThan ( 0 ) ;
7476 } ) ;
7577 } ) ;
0 commit comments