UNPKG

react95-native

Version:

Refreshed Windows 95 style UI components for your React Native app

44 lines 1.49 kB
import React from 'react'; import { render } from '@testing-library/react-native'; import { Card, Text } from '../..'; describe('<Card />', () => { it('should render children', () => { const { getByText } = render( /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(Text, null, "Banana dance"))); expect(getByText('Banana dance')).toBeTruthy(); }); it('should render custom styles', () => { const style = { backgroundColor: 'teal' }; const { getByTestId } = render( /*#__PURE__*/React.createElement(Card, { style: style, testID: "card" }, /*#__PURE__*/React.createElement(Text, null, "Card"))); expect(getByTestId('card')).toHaveStyle(style); }); }); describe('<Card.Content />', () => { it('should render children', () => { const { getByText } = render( /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(Card.Content, null, /*#__PURE__*/React.createElement(Text, null, "Banana dance")))); expect(getByText('Banana dance')).toBeTruthy(); }); it('should render custom styles', () => { const style = { backgroundColor: 'teal' }; const { getByTestId } = render( /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(Card.Content, { style: style, testID: "content" }))); expect(getByTestId('content')).toHaveStyle(style); }); }); //# sourceMappingURL=Card.spec.js.map