Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/wojtekmaj/vitest-react-native. Run React Native unit and component tests with Vitest
Something went wrong. Try again.
793 B · 22 lines
TSX
at main
1234567891011121314151617181920212223import { describe, expect, it } from 'vitest';import { fireEvent, render, screen } from '@testing-library/react-native';
import { NativeRouter, ThemedMessage } from './context.js';
describe('<ThemedMessage /> component', () => { it('should share the styled-components theme with a linked native dependency', async () => { await render(<ThemedMessage />);
expect(screen.getByText('Themed message').props.style).toMatchObject({ color: 'purple' }); });});
describe('<NativeRouter /> component', () => { it('should share the router with a native dependency calling useNavigate', async () => { await render(<NativeRouter />);
await fireEvent.press(screen.getByText('Navigate from dependency'));
expect(screen.getByText('Destination')).toBeOnTheScreen(); });});