29 lines
859 B
TypeScript
29 lines
859 B
TypeScript
/**
|
|
* LocationTestWrapper (components/LocationTestWrapper.tsx).
|
|
* Under jest the platform constants read as an emulator, so the wrapper is a
|
|
* passthrough; this locks that behaviour in.
|
|
*/
|
|
|
|
import React from 'react'
|
|
import { Text } from 'react-native'
|
|
import { screen } from '@testing-library/react-native'
|
|
|
|
import LocationTestWrapper from '@/components/LocationTestWrapper'
|
|
import { resetStorage, setupApiMocks } from '../mocks/api'
|
|
import { renderWithProviders } from '../helpers/render'
|
|
|
|
describe('LocationTestWrapper', () => {
|
|
it('renders its children on an emulator', async () => {
|
|
setupApiMocks()
|
|
await resetStorage()
|
|
|
|
renderWithProviders(
|
|
<LocationTestWrapper>
|
|
<Text>app content</Text>
|
|
</LocationTestWrapper>,
|
|
{ centralStores: false }
|
|
)
|
|
|
|
expect(screen.getByText('app content')).toBeVisible()
|
|
})
|
|
})
|