UNPKG

@hc.ds/mobile

Version:
41 lines 1.35 kB
import React from 'react'; import { MinimizedView } from './minimizedview'; import { fireEvent, render } from '@testing-library/react-native'; describe('MinimizedView', () => { const onPressMock = jest.fn(); const props = { title: 'Anchored in Peace', description: 'Andy Wood', testID: 'MZV-1', onPress: onPressMock, buttonText: 'MV Button' }; it('should render', () => { const { getByText } = render( /*#__PURE__*/React.createElement(MinimizedView, props)); expect(getByText('Anchored in Peace')).toBeDefined(); }); it('should render button', () => { const { getByText } = render( /*#__PURE__*/React.createElement(MinimizedView, props)); expect(getByText('MV Button')).toBeDefined(); }); it('should render desc', () => { const { getByTestId } = render( /*#__PURE__*/React.createElement(MinimizedView, props)); const desc = getByTestId('hcds-mobile-text-minimized-view-desc-MZV-1'); expect(desc).toBeTruthy(); }); it('should call onPress', () => { const { getByTestId } = render( /*#__PURE__*/React.createElement(MinimizedView, props)); const mvBtn = getByTestId('hcds-mobile-btn-minimized-view-MZV-1'); fireEvent.press(mvBtn); expect(onPressMock).toHaveBeenCalled(); }); }); //# sourceMappingURL=minimizedview.spec.js.map