UNPKG

vcc-ui

Version:

VCC UI is a collection of React UI Components that can be used for developing front-end applications at Volvo Car Corporation.

32 lines 1.04 kB
import React from 'react'; import { Spacer } from '.'; import createSnapshot from '../../test/create-snapshot'; import render from '../../test/render'; describe('<Spacer />', function () { it('renders <spacer /> correctly with default props', function () { var snapshot = createSnapshot(React.createElement(Spacer, null)); expect(snapshot).toMatchSnapshot(); }); it('Renders <Spacer /> with custom size', function () { var snapshot = createSnapshot(React.createElement(Spacer, { size: 3 })); expect(snapshot).toMatchSnapshot(); }); it('Renders <Spacer /> with multiple custom sizes', function () { var snapshot = createSnapshot(React.createElement(Spacer, { size: { default: 2, '@media (min-width: 768px)': 8 } })); expect(snapshot).toMatchSnapshot(); }); it('correctly implements ref prop', function () { var mockRef = React.createRef(); render(React.createElement(Spacer, { ref: mockRef })); expect(mockRef.current).not.toBe(null); }); });