Add tests for AppHelp component

This commit is contained in:
MariaZ
2022-09-20 10:48:31 +02:00
parent 2e060d3261
commit 5c2a80c5c2
2 changed files with 71 additions and 0 deletions
+20
View File
@@ -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(<AppHelp text={text} />)
expect(toJSON()).toMatchSnapshot()
})
})