Query Search Page (#1122)

* Query search page under SQL Lab tab

* Modifications based on comments

* Hash

* Added spec and endpoint test with modifications
based on second round comments

* Changed permission menu in https://github.com/airbnb/caravel/pull/1095/files
This commit is contained in:
vera-liu
2016-09-23 16:13:18 -07:00
committed by GitHub
parent 98902599ff
commit d5c5c0d6ac
13 changed files with 345 additions and 144 deletions

View File

@@ -0,0 +1,30 @@
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', () => {
it('should render', () => {
expect(
React.isValidElement(<QuerySearch />)
).to.equal(true);
});
it('should have two Select', () => {
const wrapper = shallow(<QuerySearch />);
expect(wrapper.find(Select)).to.have.length(2);
});
it('should have one input for searchText', () => {
const wrapper = shallow(<QuerySearch />);
expect(wrapper.find('input')).to.have.length(1);
});
it('should have one Button', () => {
const wrapper = shallow(<QuerySearch />);
expect(wrapper.find(Button)).to.have.length(1);
});
});