mirror of
https://github.com/inaturalist/iNaturalistReactNative.git
synced 2026-06-20 13:38:42 -04:00
36 lines
1.1 KiB
JavaScript
36 lines
1.1 KiB
JavaScript
import { faker } from "@faker-js/faker";
|
|
import { screen } from "@testing-library/react-native";
|
|
import { Map } from "components/SharedComponents";
|
|
import React from "react";
|
|
|
|
import { renderComponent } from "../../../helpers/render";
|
|
|
|
describe( "Map", ( ) => {
|
|
it( "should be accessible", ( ) => {
|
|
expect( <Map /> ).toBeAccessible( );
|
|
} );
|
|
|
|
it( "displays filtered observations on map", async ( ) => {
|
|
renderComponent(
|
|
<Map
|
|
withPressableObsTiles
|
|
tileMapParams={{ taxon_id: 47178 }}
|
|
/>
|
|
);
|
|
const tiles = await screen.findByTestId( "Map.UrlTile" );
|
|
expect( tiles ).toHaveProp( "urlTemplate", "https://api.inaturalist.org/v2/grid/{z}/{x}/{y}.png?taxon_id=47178&color=%2374ac00&verifiable=true" );
|
|
} );
|
|
|
|
it( "displays location indicator when given an observation lat/lng", async ( ) => {
|
|
renderComponent(
|
|
<Map
|
|
showLocationIndicator
|
|
obsLatitude={Number( faker.address.latitude( ) )}
|
|
obsLongitude={Number( faker.address.longitude( ) )}
|
|
/>
|
|
);
|
|
const testId = "Map.LocationIndicator";
|
|
expect( screen.getByTestId( testId ) ).toBeTruthy();
|
|
} );
|
|
} );
|