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.

29 lines 993 B
import React from 'react'; import { Card } from '.'; import createSnapshot from '../../test/create-snapshot'; import render from '../../test/render'; describe('<Card />', function () { it('renders correctly with default props', function () { var snapshot = createSnapshot(React.createElement(Card, null, "Children")); expect(snapshot).toMatchSnapshot(); }); it('renders correctly with selected=true', function () { var snapshot = createSnapshot(React.createElement(Card, { selected: true }, "Children")); expect(snapshot).toMatchSnapshot(); }); it('renders correctly with href', function () { var snapshot = createSnapshot(React.createElement(Card, { href: "#test" }, "Children")); expect(snapshot).toMatchSnapshot(); }); it('correctly implements ref prop', function () { var mockRef = React.createRef(); render(React.createElement(Card, { ref: mockRef }, "Hi")); expect(mockRef.current).not.toBe(null); }); });