|
| 1 | +import {Transformation} from "../../../src"; |
| 2 | +import {Effect} from "../../../src/actions/effect"; |
| 3 | + |
| 4 | +describe('SimpleEffect.toJson()', () => { |
| 5 | + it('effect.boomerang', () => { |
| 6 | + const transformation = new Transformation() |
| 7 | + .addAction(Effect.boomerang()); |
| 8 | + expect(transformation.toJson()).toStrictEqual( [ |
| 9 | + { actionType: 'boomerang' } |
| 10 | + ]); |
| 11 | + }); |
| 12 | + |
| 13 | + it('effect.grayscale', () => { |
| 14 | + const transformation = new Transformation() |
| 15 | + .addAction(Effect.grayscale()); |
| 16 | + expect(transformation.toJson()).toStrictEqual( [ |
| 17 | + { actionType: 'grayscale' } |
| 18 | + ]); |
| 19 | + }); |
| 20 | + |
| 21 | + it('effect.advancedRedEye', () => { |
| 22 | + const transformation = new Transformation() |
| 23 | + .addAction(Effect.advancedRedEye()); |
| 24 | + expect(transformation.toJson()).toStrictEqual( [ |
| 25 | + { actionType: 'advancedRedEye' } |
| 26 | + ]); |
| 27 | + }); |
| 28 | + |
| 29 | + it('effect.negate', () => { |
| 30 | + const transformation = new Transformation() |
| 31 | + .addAction(Effect.negate()); |
| 32 | + expect(transformation.toJson()).toStrictEqual( [ |
| 33 | + { actionType: 'negate' } |
| 34 | + ]); |
| 35 | + }); |
| 36 | + |
| 37 | + it('effect.redEye', () => { |
| 38 | + const transformation = new Transformation() |
| 39 | + .addAction(Effect.redEye()); |
| 40 | + expect(transformation.toJson()).toStrictEqual( [ |
| 41 | + { actionType: 'redEye' } |
| 42 | + ]); |
| 43 | + }); |
| 44 | + |
| 45 | + it('effect.reverse', () => { |
| 46 | + const transformation = new Transformation() |
| 47 | + .addAction(Effect.reverse()); |
| 48 | + expect(transformation.toJson()).toStrictEqual( [ |
| 49 | + { actionType: 'reverse' } |
| 50 | + ]); |
| 51 | + }); |
| 52 | + |
| 53 | + it('effect.transition', () => { |
| 54 | + const transformation = new Transformation() |
| 55 | + .addAction(Effect.transition()); |
| 56 | + expect(transformation.toJson()).toStrictEqual( [ |
| 57 | + { actionType: 'transition' } |
| 58 | + ]); |
| 59 | + }); |
| 60 | +}); |
0 commit comments