UNPKG

react-native-ui-lib

Version:

<p align="center"> <img src="https://user-images.githubusercontent.com/1780255/105469025-56759000-5ca0-11eb-993d-3568c1fd54f4.png" height="250px" style="display:block"/> </p> <p align="center">UI Toolset & Components Library for React Native</p> <p a

36 lines (33 loc) 1.43 kB
import * as uut from '../CardPresenter'; describe('CardPresenter', () => { describe('extractPositionValues', () => { it('should work with basic string value', () => { expect(uut.extractPositionValues('top')).toEqual({top: true, right: false, bottom: false, left: false}); expect(uut.extractPositionValues('bottom')).toEqual({top: false, right: false, bottom: true, left: false}); expect(uut.extractPositionValues('left')).toEqual({top: false, right: false, bottom: false, left: true}); expect(uut.extractPositionValues('right')).toEqual({top: false, right: true, bottom: false, left: false}); expect(uut.extractPositionValues('')).toEqual({top: false, right: false, bottom: false, left: false}); }); it('should work with basic array of positions', () => { expect(uut.extractPositionValues(['top', 'bottom'])).toEqual({ top: true, right: false, bottom: true, left: false }); expect(uut.extractPositionValues(['left', 'right'])).toEqual({ top: false, right: true, bottom: false, left: true }); expect(uut.extractPositionValues(['top', 'left', 'bottom', 'right'])).toEqual({ top: true, right: true, bottom: true, left: true }); expect(uut.extractPositionValues([])).toEqual({top: false, right: false, bottom: false, left: false}); }); }); });