|
| 1 | +import {fromJson} from "../../../src/internal/fromJson"; |
| 2 | + |
| 3 | +describe('effect.fromJson', () => { |
| 4 | + it('should generate a url with resize actions from array of models', function () { |
| 5 | + const transformation = fromJson([ |
| 6 | + { actionType: 'sepia' }, |
| 7 | + { actionType: 'boomerang' }, |
| 8 | + { actionType: 'grayscale' }, |
| 9 | + { actionType: 'advancedRedEye' }, |
| 10 | + { actionType: 'negate' }, |
| 11 | + { actionType: 'redEye' }, |
| 12 | + { actionType: 'reverse' }, |
| 13 | + { actionType: 'transition' }, |
| 14 | + { actionType: 'shadow', offsetX: 5, color: 'red'}, |
| 15 | + { actionType: 'colorize', level: 10, color: 'red' }, |
| 16 | + { actionType: 'oilPaint', level: 8 }, |
| 17 | + { actionType: 'cartoonify', colorReductionLevel: 80, lineStrength: 70 }, |
| 18 | + { actionType: 'outline', width: 100, color: 'lightblue' }, |
| 19 | + { actionType: 'blackwhite', level: 40 }, |
| 20 | + { actionType: 'accelerate' }, |
| 21 | + { actionType: 'loop', iterations: 5 }, |
| 22 | + { actionType: 'makeTransparent', tolerance: 5, color: 'red' }, |
| 23 | + { actionType: 'noise', level: 50 }, |
| 24 | + { actionType: 'vignette', level: 5 }, |
| 25 | + { actionType: 'dither', type: 9 }, |
| 26 | + { actionType: 'vectorize', numOfColors: 17, detailLevel: 100 }, |
| 27 | + { actionType: 'gradientFade', strength: 5, horizontalStartPoint: 10, verticalStartPoint: 20 }, |
| 28 | + { actionType: 'assistColorblind', type: 'stripes', stripesStrength: 20 }, |
| 29 | + { actionType: 'assistColorblind', type: 'xray' }, |
| 30 | + { actionType: 'simulateColorblind', condition: 'rod_monochromacy' }, |
| 31 | + { actionType: 'deshake', pixels: 16 }, |
| 32 | + { actionType: 'pixelate', squareSize: 15, region: { RegionType: 'faces' }}, |
| 33 | + { actionType: 'blur', strength: 5 } |
| 34 | + ]); |
| 35 | + |
| 36 | + expect(transformation.toString()).toStrictEqual([ |
| 37 | + 'e_sepia', |
| 38 | + 'e_boomerang', |
| 39 | + 'e_grayscale', |
| 40 | + 'e_adv_redeye', |
| 41 | + 'e_negate', |
| 42 | + 'e_redeye', |
| 43 | + 'e_reverse', |
| 44 | + 'e_transition', |
| 45 | + 'co_red,e_shadow,x_5', |
| 46 | + 'co_red,e_colorize:10', |
| 47 | + 'e_oil_paint:8', |
| 48 | + 'e_cartoonify:70:80', |
| 49 | + 'co_lightblue,e_outline:100', |
| 50 | + 'e_blackwhite:40', |
| 51 | + 'e_accelerate', |
| 52 | + 'e_loop:5', |
| 53 | + 'co_red,e_makeTransparent:5', |
| 54 | + 'e_noise:50', |
| 55 | + 'e_vignette:5', |
| 56 | + 'e_dither:9', |
| 57 | + 'e_vectorize:colors:17:detail:100', |
| 58 | + 'e_gradient_fade:5,x_10,y_20', |
| 59 | + 'e_assist_colorblind:20', |
| 60 | + 'e_assist_colorblind:xray', |
| 61 | + 'e_simulate_colorblind:rod_monochromacy', |
| 62 | + 'e_deshake:16', |
| 63 | + 'e_pixelate_faces:15', |
| 64 | + 'e_blur:5' |
| 65 | + ].join('/')); |
| 66 | + }); |
| 67 | +}); |
0 commit comments