mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
feat: Better return messages in SQL Editor (#14381)
* Sqllab limit * Add migration script * Set default values * initial push * revisions * moving migration to separate PR * revisions * Fix apply_limit_to_sql * all but tests * added unit tests * result set * first draft * revisions * made user required prop, added it to all places ResultSet is imported * changed QueryTable test to allow for useSelector * Query Table working * working with heights * fixed scrolling * got rid of animated * fixed tests, revisions * revisions * revisions * heights * fun with heights * alert state * aaron helped me fix this * better alert messages * fixed result set test Co-authored-by: Beto Dealmeida <roberto@dealmeida.net>
This commit is contained in:
@@ -17,11 +17,14 @@
|
||||
* under the License.
|
||||
*/
|
||||
import React from 'react';
|
||||
import { shallow } from 'enzyme';
|
||||
import thunk from 'redux-thunk';
|
||||
import configureStore from 'redux-mock-store';
|
||||
import { styledMount as mount } from 'spec/helpers/theming';
|
||||
import QueryTable from 'src/SqlLab/components/QueryTable';
|
||||
import TableView from 'src/components/TableView';
|
||||
import { TableCollection } from 'src/components/dataViewCommon';
|
||||
import { queries } from './fixtures';
|
||||
import { Provider } from 'react-redux';
|
||||
import { queries, user } from './fixtures';
|
||||
|
||||
describe('QueryTable', () => {
|
||||
const mockedProps = {
|
||||
@@ -35,12 +38,18 @@ describe('QueryTable', () => {
|
||||
expect(React.isValidElement(<QueryTable {...mockedProps} />)).toBe(true);
|
||||
});
|
||||
it('renders a proper table', () => {
|
||||
const wrapper = shallow(<QueryTable {...mockedProps} />);
|
||||
const tableWrapper = wrapper
|
||||
.find(TableView)
|
||||
.shallow()
|
||||
.find(TableCollection)
|
||||
.shallow();
|
||||
const mockStore = configureStore([thunk]);
|
||||
const store = mockStore({
|
||||
sqlLab: user,
|
||||
});
|
||||
|
||||
const wrapper = mount(
|
||||
<Provider store={store}>
|
||||
<QueryTable {...mockedProps} />
|
||||
</Provider>,
|
||||
);
|
||||
const tableWrapper = wrapper.find(TableView).find(TableCollection);
|
||||
|
||||
expect(wrapper.find(TableView)).toExist();
|
||||
expect(tableWrapper.find('table')).toExist();
|
||||
expect(tableWrapper.find('table').find('thead').find('tr')).toHaveLength(1);
|
||||
|
||||
Reference in New Issue
Block a user