import React from "react";
import { render, screen } from "@testing-library/react";
import { describe, expect, it } from "vitest";
import { Marker, Root } from "./index";

describe("POIMarker", () => {
  it("renders poi marker", async () => {
    render(
      <Root
        options={{
          type: "groceries",
          poi: {
            name: "Safeway",
            address: "145 Jackson St",
            city: "San Francisco",
            province: "CA",
            postalcode: "94111-1915",
            country: "USA",
            lat: 37.796567,
            lng: -122.398839,
            url: "http://local.safeway.com/ca/san-francisco-4601.html",
            proximity: {
              linear_distance: 395,
            },
          },
          isOpen: true,
          isHovered: true,
          side: "right",
        }}
      >
        <Marker />
      </Root>
    );

    const role = screen.getByTestId("svgInfo");
    expect(role).toBeDefined();
  });
});
