Files
iNaturalistReactNative/tests/unit/components/SharedComponents/ActivityCount/IdentificationsCount.test.js
Johannes Klein 868c95ee13 494 activity count (#495)
* 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
2023-03-17 11:55:29 -07:00

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();
} );
} );