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.
27 lines • 1.01 kB
JavaScript
import React from 'react';
import { CardContent } from '.';
import createSnapshot from '../../test/create-snapshot';
import render from '../../test/render';
describe('<CardContent />', function () {
it('renders correctly with default props', function () {
var snapshot = createSnapshot(React.createElement(CardContent, null, "Children"));
expect(snapshot).toMatchSnapshot();
});
it('renders correctly with selected=true', function () {
var snapshot = createSnapshot(React.createElement(CardContent, null, "Children"));
expect(snapshot).toMatchSnapshot();
});
it('renders correctly with href', function () {
var snapshot = createSnapshot(React.createElement(CardContent, {
href: "#test"
}, "Children"));
expect(snapshot).toMatchSnapshot();
});
it('correctly implements ref prop', function () {
var mockRef = React.createRef();
render(React.createElement(CardContent, {
ref: mockRef
}, "Hi"));
expect(mockRef.current).not.toBe(null);
});
});