UNPKG

react95-native

Version:

Refreshed Windows 95 style UI components for your React Native app

30 lines 870 B
import React from 'react'; import { render } from '@testing-library/react-native'; import { Text } from '../..'; const mockOpenUrl = jest.fn(url => Promise.resolve(url)); describe('<Text />', () => { beforeEach(() => { mockOpenUrl.mockClear(); jest.doMock('react-native/Libraries/Linking/Linking', () => ({ openURL: mockOpenUrl })); }); it('should render children', () => { const { getByText } = render( /*#__PURE__*/React.createElement(Text, null, "Potato")); expect(getByText('Potato')).toBeTruthy(); }); it('should render custom styles', () => { const style = { color: 'papayawhip' }; const { getByText } = render( /*#__PURE__*/React.createElement(Text, { style: style }, "Potato")); expect(getByText('Potato')).toHaveStyle(style); }); }); //# sourceMappingURL=Text.spec.js.map