mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
apply redux for VisualizeModal (#2795)
* redux visualize modal * redux visualize modal - apply redux - add unit test for connect container component - fix lint error * redux visualize modal - apply redux - add unit test for connect container component - fix lint error
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
import React from 'react';
|
||||
import { mount } from 'enzyme';
|
||||
import { shallow } from 'enzyme';
|
||||
import { describe, it } from 'mocha';
|
||||
import { expect } from 'chai';
|
||||
import { Table } from 'reactable';
|
||||
|
||||
import { queries } from './fixtures';
|
||||
import QueryTable from '../../../javascripts/SqlLab/components/QueryTable';
|
||||
|
||||
|
||||
describe('QueryTable', () => {
|
||||
const mockedProps = {
|
||||
queries,
|
||||
@@ -20,8 +20,9 @@ describe('QueryTable', () => {
|
||||
).to.equal(true);
|
||||
});
|
||||
it('renders a proper table', () => {
|
||||
const wrapper = mount(<QueryTable {...mockedProps} />);
|
||||
expect(wrapper.find('table')).to.have.length(1);
|
||||
expect(wrapper.find('tr')).to.have.length(4);
|
||||
const wrapper = shallow(<QueryTable {...mockedProps} />);
|
||||
expect(wrapper.find(Table)).to.have.length(1);
|
||||
expect(wrapper.find(Table).shallow().find('table')).to.have.length(1);
|
||||
expect(wrapper.find(Table).shallow().find('table').find('Tr')).to.have.length(2);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user