UNPKG

ec-react15-lib

Version:

Enormous Cloud Applications Rendering Framework, version for React 0.15

39 lines (36 loc) 979 B
import { enableLogger, expectWarn, expectNoWarn } from './../Logger.mock'; import { Operation$Screens } from './Operation$Screens'; const context = { browser: { mediaType: 'md' } }; describe ('Operation.$Screens', () => { it('should work on correct operands and return true', () => { enableLogger(() => { const cond = { op: ['xs', 'md', 'lg'], operation: '$screens' }; expect(Operation$Screens(cond, context)).toEqual(true); }); expectNoWarn(); }); it('should work on correct operands and return false', () => { enableLogger(() => { const cond = { op: ['xs', 'lg'], operation: '$screens' }; expect(Operation$Screens(cond, context)).toEqual(false); }); expectNoWarn(); }); it('should not work on incorrect operands', () => { const cond = { op2: 'temp', operation: '$screens' }; expect(Operation$Screens(cond, context)); expectWarn(); }); });