mirror of
https://github.com/inaturalist/iNaturalistReactNative.git
synced 2026-04-20 14:58:35 -04:00
* Refactor to boolean prop for white or gray * Rename prop * Add component for comments count * Reorder strings * Use CommentsCount * Add identifications count component * Add snapshot test for ActivityCount * Add tests TODO for component * Updated with new icons * Add snapshot tests * Update ActivityCount.test.js.snap * Unit test for count text * Remove testing comments count in ObsList test * Update with changes from main * Update IdentificationsCount.test.js.snap * Remove components from ObsStatus
41 lines
1.0 KiB
JavaScript
41 lines
1.0 KiB
JavaScript
import { render, screen } from "@testing-library/react-native";
|
|
import { IdentificationsCount } from "components/SharedComponents";
|
|
import initI18next from "i18n/initI18next";
|
|
import React from "react";
|
|
|
|
const count = 1;
|
|
|
|
describe( "IdentificationsCount", () => {
|
|
beforeAll( async () => {
|
|
await initI18next();
|
|
} );
|
|
|
|
it( "renders default reliably", () => {
|
|
// Snapshot test
|
|
render( <IdentificationsCount count={count} /> );
|
|
|
|
expect( screen ).toMatchSnapshot();
|
|
} );
|
|
|
|
it( "renders white reliably", () => {
|
|
// Snapshot test
|
|
render( <IdentificationsCount count={count} white /> );
|
|
|
|
expect( screen ).toMatchSnapshot();
|
|
} );
|
|
|
|
it( "renders filled reliably", () => {
|
|
// Snapshot test
|
|
render( <IdentificationsCount count={count} filled /> );
|
|
|
|
expect( screen ).toMatchSnapshot();
|
|
} );
|
|
|
|
// a11y test
|
|
it( "should not have accessibility errors", () => {
|
|
const activityCount = <IdentificationsCount count={count} />;
|
|
|
|
expect( activityCount ).toBeAccessible();
|
|
} );
|
|
} );
|