Move react-i18next mock to jest-setup.js
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import React from 'react'
|
||||
import { render, screen, fireEvent } from '@testing-library/react-native'
|
||||
|
||||
import AcceptLicense from '../../components/AcceptLicense'
|
||||
|
||||
import { saveLicenseFlag } from '../../local-storage'
|
||||
@@ -8,14 +9,6 @@ jest.mock('../../local-storage', () => ({
|
||||
saveLicenseFlag: jest.fn(() => Promise.resolve()),
|
||||
}))
|
||||
|
||||
jest.mock('react-i18next', () => ({
|
||||
useTranslation: () => ({
|
||||
t: (str, options) => {
|
||||
return str + (options ? JSON.stringify(options) : '')
|
||||
},
|
||||
}),
|
||||
}))
|
||||
|
||||
describe('AcceptLicense', () => {
|
||||
test('On clicking OK button, the license is accepted', async () => {
|
||||
const mockedSetLicense = jest.fn()
|
||||
|
||||
Reference in New Issue
Block a user