Massive/tests/App.test.tsx

25 lines
591 B
TypeScript
Raw Normal View History

2023-01-01 05:33:03 +00:00
import React from 'react'
import 'react-native'
2023-06-27 03:16:59 +00:00
import { render, waitFor } from 'react-native-testing-library'
2023-01-01 05:33:03 +00:00
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 () => {
2023-06-27 03:16:59 +00:00
const { getAllByText } = render(<App />)
2023-01-01 05:33:03 +00:00
const title = await waitFor(() => getAllByText('Home'))
expect(title.length).toBeGreaterThan(0)
})