Massive/tests/App.test.tsx
Brandon Presley b41c30d886 Replace it with test for jest files
Test explains what it is we are writing, whereas it
doesn't.
2023-01-04 13:44:28 +13:00

25 lines
587 B
TypeScript

import React from 'react'
import 'react-native'
import {render, waitFor} from 'react-native-testing-library'
import App from '../App'
import Settings from '../settings'
jest.mock('../db.ts', () => ({
settingsRepo: {
findOne: () => Promise.resolve({} as Settings),
},
}))
jest.mock('../data-source.ts', () => ({
AppDataSource: {
isInitialized: false,
initialize: jest.fn(),
},
}))
test('renders correctly', async () => {
const {getAllByText} = render(<App />)
const title = await waitFor(() => getAllByText('Home'))
expect(title.length).toBeGreaterThan(0)
})