lucid-ui
Version:
A UI component library from AppNexus.
60 lines • 2.21 kB
JavaScript
import React from 'react';
import { shallow } from 'enzyme';
import { common } from '../../util/generic-tests';
import ProgressBar from './ProgressBar';
describe('ProgressBar', function () {
common(ProgressBar, {
selectRoot: function selectRoot(wrapper) {
return wrapper.find('.lucid-ProgressBar');
}
});
describe('render', function () {
it('should render a ProgressBar', function () {
var wrapper = shallow( /*#__PURE__*/React.createElement(ProgressBar, null));
expect(wrapper).toMatchSnapshot();
});
});
describe('props', function () {
describe('kind', function () {
it('should match snapshot for default', function () {
expect(shallow( /*#__PURE__*/React.createElement(ProgressBar, {
kind: "default"
}))).toMatchSnapshot();
});
it('should match snapshot for success', function () {
expect(shallow( /*#__PURE__*/React.createElement(ProgressBar, {
kind: "success"
}))).toMatchSnapshot();
});
it('should match snapshot for warning', function () {
expect(shallow( /*#__PURE__*/React.createElement(ProgressBar, {
kind: "warning"
}))).toMatchSnapshot();
});
it('should match snapshot for danger', function () {
expect(shallow( /*#__PURE__*/React.createElement(ProgressBar, {
kind: "danger"
}))).toMatchSnapshot();
});
it('should match snapshot for info', function () {
expect(shallow( /*#__PURE__*/React.createElement(ProgressBar, {
kind: "info"
}))).toMatchSnapshot();
});
});
describe('percentComplete', function () {
it('should display length of ProgressBar', function () {
expect(shallow( /*#__PURE__*/React.createElement(ProgressBar, {
percentComplete: 75
}))).toMatchSnapshot();
});
});
});
describe('childComponents', function () {
describe('Title', function () {
it('should render a header', function () {
expect(shallow( /*#__PURE__*/React.createElement(ProgressBar, null, /*#__PURE__*/React.createElement(ProgressBar.Title, null, "Title")))).toMatchSnapshot();
});
});
});
});