mirror of
https://github.com/inaturalist/iNaturalistReactNative.git
synced 2026-01-04 11:58:08 -05:00
* Don't require TS extensions in imports * Resolve all import extension errors * Remove file extension from import paths used in mocks * Remove .d of type definition file paths * Remove .d of type definition file and import as type --------- Co-authored-by: Johannes Klein <johannes.t.klein@gmail.com>
19 lines
661 B
JavaScript
19 lines
661 B
JavaScript
import { fireEvent, render, screen } from "@testing-library/react-native";
|
|
import OfflineNotice from "components/SharedComponents/OfflineNotice";
|
|
import i18next from "i18next";
|
|
import React from "react";
|
|
|
|
describe( "OfflineNotice", ( ) => {
|
|
it( "should throw without an onPress prop", ( ) => {
|
|
expect( ( ) => render( <OfflineNotice /> ) ).toThrow( );
|
|
} );
|
|
|
|
it( "should be pressable", ( ) => {
|
|
const onPress = jest.fn( );
|
|
render( <OfflineNotice onPress={onPress} /> );
|
|
const notice = screen.getByLabelText( i18next.t( "Internet-Connection-Required" ) );
|
|
fireEvent.press( notice );
|
|
expect( onPress ).toHaveBeenCalled( );
|
|
} );
|
|
} );
|