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.

54 lines 1.98 kB
import React from 'react'; import { Grid } from '.'; import { Row } from '../row'; import { Col } from '../col'; import createSnapshot from '../../test/create-snapshot'; describe('<Grid />', function () { it('renders correctly', function () { var snapshot = createSnapshot(React.createElement(Grid, null, "Mock child")); expect(snapshot).toMatchSnapshot(); }); describe('<Col />', function () { it('renders correctly with default props', function () { var snapshot = createSnapshot(React.createElement(Col, null, "Mock child")); expect(snapshot).toMatchSnapshot(); }); it('renders correctly when size prop is a number', function () { var snapshot = createSnapshot(React.createElement(Col, { size: 4 }, "Mock child")); expect(snapshot).toMatchSnapshot(); }); it('renders correctly when size prop is an object', function () { var snapshot = createSnapshot(React.createElement(Col, { size: { default: 4, '@media (min-width: 480px)': 3, '@media (min-width: 1024px)': 6 } }, "Mock child")); expect(snapshot).toMatchSnapshot(); }); it('renders correctly when size prop is an object missing default property', function () { var snapshot = createSnapshot(React.createElement(Col, { size: { '@media (min-width: 480px)': 5, '@media (min-width: 1024px)': 6 } }, "Mock child")); expect(snapshot).toMatchSnapshot(); }); }); describe('<Row />', function () { it('renders correctly with default props', function () { var snapshot = createSnapshot(React.createElement(Row, null, "Mock child")); expect(snapshot).toMatchSnapshot(); }); it('renders correctly with custom align prop', function () { var snapshot = createSnapshot(React.createElement(Row, { align: "end" }, "Mock child")); expect(snapshot).toMatchSnapshot(); }); }); });