diff --git a/test/components/common/AppHelp.spec.js b/test/components/common/AppHelp.spec.js new file mode 100644 index 0000000..ac61344 --- /dev/null +++ b/test/components/common/AppHelp.spec.js @@ -0,0 +1,20 @@ +import React from 'react' +import { render } from '@testing-library/react-native' +import AppHelp from '../../../components/common/AppHelp' + +jest.mock('react-i18next', () => ({ + useTranslation: () => ({ + t: (str, options) => { + return str + (options ? JSON.stringify(options) : '') + }, + }), +})) + +describe('AppHelp screen', () => { + test('when provided text, should render it', async () => { + const text = 'Some help test' + const { toJSON } = render() + + expect(toJSON()).toMatchSnapshot() + }) +}) diff --git a/test/components/common/__snapshots__/AppHelp.spec.js.snap b/test/components/common/__snapshots__/AppHelp.spec.js.snap new file mode 100644 index 0000000..7e73112 --- /dev/null +++ b/test/components/common/__snapshots__/AppHelp.spec.js.snap @@ -0,0 +1,51 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AppHelp screen when provided text, should render it 1`] = ` + + + * + + + Some help test + + +`;