import { fireEvent, screen } from "@testing-library/react-native"; import EmptyMapSection from "components/Match/EmptyMapSection"; import React from "react"; import { renderComponent } from "tests/helpers/render"; describe( "EmptyMapSection", () => { const mockHandleAddLocationPressed = jest.fn(); it( "displays the location indicator icon", () => { renderComponent( , ); const locationIndicator = screen.getByTestId( "Map.LocationIndicator" ); expect( locationIndicator ).toBeVisible(); } ); it( "calls handleAddLocationPressed when button is pressed", () => { renderComponent( , ); const button = screen.getByText( "ADD LOCATION FOR BETTER IDS" ); fireEvent.press( button ); expect( mockHandleAddLocationPressed ).toHaveBeenCalled(); } ); it( "shows loading state when isFetchingLocation is true", () => { renderComponent( , ); const button = screen.getByLabelText( "Edit location" ); expect( button.props.accessibilityState.disabled ).toBe( true ); } ); } );