import { handleCollapseDirection } from './variants'; describe('Tests variants', () => { test('open without arguments', () => { expect(handleCollapseDirection({})).toStrictEqual({ height: 'auto', }); }); test("open with direction='up'", () => { expect(handleCollapseDirection({ direction: 'up' })).toStrictEqual({ height: 'auto', }); }); test("open with direction='down'", () => { expect(handleCollapseDirection({ direction: 'down' })).toStrictEqual({ height: 'auto', }); }); test("open with direction='vertical'", () => { expect(handleCollapseDirection({ direction: 'vertical' })).toStrictEqual({ height: 'auto', }); }); test("open with direction='right'", () => { expect(handleCollapseDirection({ direction: 'right' })).toStrictEqual({ width: 'auto', }); }); test("open with direction='left'", () => { expect(handleCollapseDirection({ direction: 'left' })).toStrictEqual({ width: 'auto', }); }); test("open with direction='horizontal'", () => { expect(handleCollapseDirection({ direction: 'horizontal' })).toStrictEqual({ width: 'auto', }); }); test("close with direction='vertical' and close=true", () => { expect( handleCollapseDirection({ direction: 'vertical' }, true) ).toStrictEqual({ height: 0, }); }); test("close with direction='horizontal' and close=true", () => { expect( handleCollapseDirection({ direction: 'horizontal' }, true) ).toStrictEqual({ width: 0, }); }); });