UNPKG

react-ions

Version:

An open source set of React components that implement Ambassador's Design and UX patterns.

118 lines (92 loc) 4.45 kB
'use strict'; var _react = require('react'); var _react2 = _interopRequireDefault(_react); var _Chip = require('../Chip'); var _Chip2 = _interopRequireDefault(_Chip); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } describe('Chip', function () { it('should render with the primary color', function () { var chip = shallow(_react2.default.createElement(_Chip2.default, { color: 'primary' })); expect(chip).toMatchSnapshot(); }); it('should render with the primary-1 color', function () { var chip = shallow(_react2.default.createElement(_Chip2.default, { color: 'primary-1' })); expect(chip).toMatchSnapshot(); }); it('should render with the primary-2 color', function () { var chip = shallow(_react2.default.createElement(_Chip2.default, { color: 'primary-2' })); expect(chip).toMatchSnapshot(); }); it('should render with the primary-3 color', function () { var chip = shallow(_react2.default.createElement(_Chip2.default, { color: 'primary-3' })); expect(chip).toMatchSnapshot(); }); it('should render with the primary-4 color', function () { var chip = shallow(_react2.default.createElement(_Chip2.default, { color: 'primary-4' })); expect(chip).toMatchSnapshot(); }); it('should render with the primary-5 color', function () { var chip = shallow(_react2.default.createElement(_Chip2.default, { color: 'primary-5' })); expect(chip).toMatchSnapshot(); }); it('should render with the primary-darker color', function () { var chip = shallow(_react2.default.createElement(_Chip2.default, { color: 'primary-darker' })); expect(chip).toMatchSnapshot(); }); it('should render with the primary-6 color', function () { var chip = shallow(_react2.default.createElement(_Chip2.default, { color: 'primary-6' })); expect(chip).toMatchSnapshot(); }); it('should render with the neutral-1 color', function () { var chip = shallow(_react2.default.createElement(_Chip2.default, { color: 'neutral-1' })); expect(chip).toMatchSnapshot(); }); it('should render with the neutral-2 color', function () { var chip = shallow(_react2.default.createElement(_Chip2.default, { color: 'neutral-2' })); expect(chip).toMatchSnapshot(); }); it('should render with the neutral-3 color', function () { var chip = shallow(_react2.default.createElement(_Chip2.default, { color: 'neutral-3' })); expect(chip).toMatchSnapshot(); }); it('should render with the neutral-4 color', function () { var chip = shallow(_react2.default.createElement(_Chip2.default, { color: 'neutral-4' })); expect(chip).toMatchSnapshot(); }); it('should render with the danger color', function () { var chip = shallow(_react2.default.createElement(_Chip2.default, { color: 'danger' })); expect(chip).toMatchSnapshot(); }); it('should render with the success color', function () { var chip = shallow(_react2.default.createElement(_Chip2.default, { color: 'success' })); expect(chip).toMatchSnapshot(); }); it('should render with the warning color', function () { var chip = shallow(_react2.default.createElement(_Chip2.default, { color: 'warning' })); expect(chip).toMatchSnapshot(); }); it('should render with the info color', function () { var chip = shallow(_react2.default.createElement(_Chip2.default, { color: 'info' })); expect(chip).toMatchSnapshot(); }); it('should render with a className', function () { var chip = shallow(_react2.default.createElement(_Chip2.default, { className: 'classy-class' })); expect(chip).toMatchSnapshot(); }); it('should render with text', function () { var chip = shallow(_react2.default.createElement(_Chip2.default, { text: 'text' })); expect(chip).toMatchSnapshot(); }); it('should render with a larger size', function () { var chip = shallow(_react2.default.createElement(_Chip2.default, { size: 'larger' })); expect(chip).toMatchSnapshot(); }); it('should render with a smaller size', function () { var chip = shallow(_react2.default.createElement(_Chip2.default, { size: 'smaller' })); expect(chip).toMatchSnapshot(); }); it('should render with a style object', function () { var chip = shallow(_react2.default.createElement(_Chip2.default, { size: 'smaller', style: { marginRight: '4px' } })); expect(chip).toMatchSnapshot(); }); });