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

describe("POIList", () => {
  it("renders POI as a list", async () => {
    render(
      <Root
        options={{
          data,
          type: "poi",
          activePOI: {
            address: "783 De Bienville Rue",
            city: "Montréal",
            country: "Canada",
            lat: 45.526794,
            lng: -73.58316,
            name: "Illusion Théâtre Marionnettes",
            postalcode: "H2J1T8",
            province: "QC",
            url: "https://illusiontheatre.com",
            proximity: {
              linear_distance: 416,
            },
          },
        }}
      />
    );
    const poi = await screen.getByText("Épicerie de Grand-Pre");
    expect(poi).toBeDefined();
  });
});
