1234567891011121314151617181920212223242526272829303132333435363738 |
- import {
- makeFlagMarker,
- makeLine,
- makeQuestionMarker,
- } from "../hooks/useMarkersFromGuesses/markers";
- describe("markers", () => {
- describe("makeLine", () => {
- it("makes a line", () => {
- const result = makeLine("p1", "p2", "map", "color");
- expect(result).toMatchSnapshot();
- });
- });
- describe("makeQuestionMarker", () => {
- it("makes a question marker", () => {
- const result = makeQuestionMarker(
- "map",
- { lat: "lat", lng: "lng" },
- "title",
- "color"
- );
- expect(result).toMatchSnapshot();
- result.listeners.get("click")[0]();
- expect(global.window.open).toHaveBeenCalledWith(
- "https://www.google.com/maps?hl=en&q=+lat,+lng",
- "_blank"
- );
- });
- });
- describe("makeFlagMarker", () => {
- it("makes a flag marker", () => {
- const result = makeFlagMarker("map", { lat: "lat", lng: "lng" });
- expect(result).toMatchSnapshot();
- });
- });
- });
|