Skip to content

Instantly share code, notes, and snippets.

@pytqqq
Created February 2, 2023 13:21
Show Gist options
  • Save pytqqq/e583169f94c9b14d7c07fb5b2d17fa59 to your computer and use it in GitHub Desktop.
Save pytqqq/e583169f94c9b14d7c07fb5b2d17fa59 to your computer and use it in GitHub Desktop.
const initialWindowMetrics = {
frame: {
x: 0,
y: 0,
width: 0,
height: 0,
},
insets: {
top: 0,
left: 0,
right: 0,
bottom: 0,
},
};
test('Renders GameList', async () => {
const createWrapper = () => {
return ({children}) => (
<NativeBaseProvider initialWindowMetrics={initialWindowMetrics}>
{children}
</NativeBaseProvider>
);
};
const wrapper = createWrapper();
render(<GameList />, {wrapper});
const gameItems = await screen.findAllByTestId('game-item');
expect(gameItems).toHaveLength(1000);
expect(screen.queryByTestId('spinner')).not.toBeTruthy();
expect(screen.queryByTestId('list')).toBeTruthy();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment