Skip to content

Commit

Permalink
Fix testing map loading state
Browse files Browse the repository at this point in the history
  • Loading branch information
hudson-newey committed Dec 11, 2024
1 parent fccc7bd commit 533b6ee
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/app/components/shared/map/map.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
<p class="error-hint">
Please ensure your ad-block is not blocking Google Maps
</p>
} @else if (googleMapsLoaded === null) {
<baw-loading></baw-loading>
} @else if (!hasMarkers) {
<p>No locations specified</p>
} @else {
<baw-loading></baw-loading>
}
</div>
}
2 changes: 2 additions & 0 deletions src/app/components/shared/map/map.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,14 @@ describe("MapComponent", () => {
/** Causes all pending 'loadAsync' promises to resolve */
function triggerLoadSuccess(): void {
mapsServiceSpy.mapsState = GoogleMapsState.Loaded;
spectator.component["googleMapsLoaded"] = true;
spectator.detectChanges();
}

/** Causes all pending 'loadAsync' promises to reject */
function triggerLoadFailure(): void {
mapsServiceSpy.mapsState = GoogleMapsState.Failed;
spectator.component["googleMapsLoaded"] = false;
spectator.detectChanges();
}

Expand Down

0 comments on commit 533b6ee

Please sign in to comment.