2022-06-11 18:38:12 +03:00
|
|
|
import { render, screen } from '@testing-library/react';
|
2022-05-28 12:16:59 +03:00
|
|
|
import { MapModal } from '../../../src/visits/helpers/MapModal';
|
2023-02-18 12:40:37 +03:00
|
|
|
import type { CityStats } from '../../../src/visits/types';
|
2019-01-09 22:11:22 +03:00
|
|
|
|
|
|
|
describe('<MapModal />', () => {
|
2022-06-11 18:38:12 +03:00
|
|
|
const toggle = jest.fn();
|
2019-01-09 22:11:22 +03:00
|
|
|
const zaragozaLat = 41.6563497;
|
|
|
|
const zaragozaLong = -0.876566;
|
|
|
|
const newYorkLat = 40.730610;
|
|
|
|
const newYorkLong = -73.935242;
|
2020-09-02 21:13:31 +03:00
|
|
|
const locations: CityStats[] = [
|
2019-01-09 22:11:22 +03:00
|
|
|
{
|
|
|
|
cityName: 'Zaragoza',
|
|
|
|
count: 54,
|
2022-03-26 14:17:42 +03:00
|
|
|
latLong: [zaragozaLat, zaragozaLong],
|
2019-01-09 22:11:22 +03:00
|
|
|
},
|
|
|
|
{
|
|
|
|
cityName: 'New York',
|
|
|
|
count: 7,
|
2022-03-26 14:17:42 +03:00
|
|
|
latLong: [newYorkLat, newYorkLong],
|
2019-01-09 22:11:22 +03:00
|
|
|
},
|
|
|
|
];
|
|
|
|
|
2022-06-11 18:38:12 +03:00
|
|
|
it('renders expected map', () => {
|
|
|
|
render(<MapModal toggle={toggle} isOpen title="Foobar" locations={locations} />);
|
|
|
|
expect(screen.getByRole('dialog')).toMatchSnapshot();
|
2019-01-09 22:11:22 +03:00
|
|
|
});
|
|
|
|
});
|