mirror of
https://github.com/apache/superset.git
synced 2026-04-22 01:24:43 +00:00
* [sqllab] some frontend tests * linting * Addressing comments * Addressing unaddressed comments * Touchups
34 lines
992 B
JavaScript
34 lines
992 B
JavaScript
import React from 'react';
|
|
import Select from 'react-select';
|
|
import { Button } from 'react-bootstrap';
|
|
import QuerySearch from '../../../javascripts/SqlLab/components/QuerySearch';
|
|
import { shallow } from 'enzyme';
|
|
import { describe, it } from 'mocha';
|
|
import { expect } from 'chai';
|
|
|
|
describe('QuerySearch', () => {
|
|
const mockedProps = {
|
|
actions: {},
|
|
};
|
|
it('is valid', () => {
|
|
expect(
|
|
React.isValidElement(<QuerySearch {...mockedProps} />)
|
|
).to.equal(true);
|
|
});
|
|
|
|
it('should have two Select', () => {
|
|
const wrapper = shallow(<QuerySearch {...mockedProps} />);
|
|
expect(wrapper.find(Select)).to.have.length(2);
|
|
});
|
|
|
|
it('should have one input for searchText', () => {
|
|
const wrapper = shallow(<QuerySearch {...mockedProps} />);
|
|
expect(wrapper.find('input')).to.have.length(1);
|
|
});
|
|
|
|
it('should have one Button', () => {
|
|
const wrapper = shallow(<QuerySearch {...mockedProps} />);
|
|
expect(wrapper.find(Button)).to.have.length(1);
|
|
});
|
|
});
|