import { enter, exit, handleSlideDirection } from './variants'; describe('Tests handleSlideDirection', () => { test('without arguments', () => { expect(handleSlideDirection({})).toStrictEqual({ x: 0, y: -200, }); }); test("with direction='up'", () => { expect(handleSlideDirection({ direction: 'up' })).toStrictEqual({ x: 0, y: 200, }); }); test("with direction='down'", () => { expect(handleSlideDirection({ direction: 'down' })).toStrictEqual({ x: 0, y: -200, }); }); test("with direction='right'", () => { expect(handleSlideDirection({ direction: 'right' })).toStrictEqual({ x: -200, y: 0, }); }); test("with direction='left'", () => { expect(handleSlideDirection({ direction: 'left' })).toStrictEqual({ x: 200, y: 0, }); }); test("with direction='vertical' and distance", () => { expect( handleSlideDirection({ direction: 'vertical', distance: 400 }) ).toStrictEqual({ x: 0, y: -400, }); }); test("with direction='horizontal' and distance=600 and exit=-1", () => { expect( handleSlideDirection({ direction: 'horizontal', distance: 600 }, -1) ).toStrictEqual({ x: 600, y: 0, }); }); }); describe('Tests variants', () => { test('enter', () => { expect(enter({ direction: 'up', distance: 200 }, {}, {})); }); test('exit', () => { expect(exit({ direction: 'up', distance: 200 }, {}, {})); }); });