mirror of
https://github.com/inaturalist/iNaturalistReactNative.git
synced 2026-04-21 07:20:03 -04:00
* use `shrink` tailwind class instead of hard-coded max widths to control overflow in a few situations * fixed some spacing issues with the Toolbar during upload * center text in buttons by default * export KebabMenu from SharedComponents (how was it working without this?) * added some extra colors for debugging purposes
43 lines
989 B
JavaScript
43 lines
989 B
JavaScript
import { render, screen } from "@testing-library/react-native";
|
|
import { INatIconButton } from "components/SharedComponents";
|
|
import React from "react";
|
|
|
|
describe( "INatIconButton", () => {
|
|
it( "renders correctly", () => {
|
|
render(
|
|
<INatIconButton
|
|
icon="camera"
|
|
onPress={( ) => {
|
|
// all is well
|
|
}}
|
|
/>
|
|
);
|
|
// Snapshot test
|
|
expect( screen ).toMatchSnapshot();
|
|
} );
|
|
|
|
it( "throws an error when it receives an inaccessibly small width", ( ) => {
|
|
expect( ( ) => render(
|
|
<INatIconButton
|
|
icon="camera"
|
|
width={10}
|
|
onPress={( ) => {
|
|
// all is well
|
|
}}
|
|
/>
|
|
) ).toThrow( /width/i );
|
|
} );
|
|
|
|
it( "throws an error when it receives an inaccessibly small height", ( ) => {
|
|
expect( ( ) => render(
|
|
<INatIconButton
|
|
icon="camera"
|
|
height={10}
|
|
onPress={( ) => {
|
|
// all is well
|
|
}}
|
|
/>
|
|
) ).toThrow( /height/i );
|
|
} );
|
|
} );
|