Files
superset2/superset/assets/spec/javascripts/explore/components/RowCountLabel_spec.jsx
Chris Williams b453cd2bf2 [lint] turn no-undef back on, set browser, cypress, and mocha env's (#5879)
* [lint] turn no-undef back on, set browser, cypress, and mocha env's, and fix issues

* [lint] fix undefined var in TimeTable.jsx
2018-09-13 14:45:24 -07:00

33 lines
1012 B
JavaScript

import React from 'react';
import { expect } from 'chai';
import { shallow } from 'enzyme';
import { Label } from 'react-bootstrap';
import TooltipWrapper from './../../../../src/components/TooltipWrapper';
import RowCountLabel from '../../../../src/explore/components/RowCountLabel';
describe('RowCountLabel', () => {
const defaultProps = {
rowcount: 51,
limit: 100,
};
it('is valid', () => {
expect(React.isValidElement(<RowCountLabel {...defaultProps} />)).to.equal(true);
});
it('renders a Label and a TooltipWrapper', () => {
const wrapper = shallow(<RowCountLabel {...defaultProps} />);
expect(wrapper.find(Label)).to.have.lengthOf(1);
expect(wrapper.find(TooltipWrapper)).to.have.lengthOf(1);
});
it('renders a warning when limit is reached', () => {
const props = {
rowcount: 100,
limit: 100,
};
const wrapper = shallow(<RowCountLabel {...props} />);
expect(wrapper.find(Label).first().props().bsStyle).to.equal('warning');
});
});