mirror of
https://github.com/apache/superset.git
synced 2026-04-15 22:25:15 +00:00
* make react-virtualized table work use dynamic sizing for cell width enable filtering require height prop for result set component * fix tests and linting * move some state to props * move getTextWidth to visUtils * make striped rows optional * fix striped proptype * update name to FilterableTable * add basic test and fix linting * accept array of columns keys rather than an array of objects that needs to be mapped * move container div inside the component * rename styles * fit table component to width if it's smaller than parent container * move stylesheet to javascript folder otherwise it throws an error on npm run prod * move css to index.jsx * fix result set spec * fix linting and test * fix result set props * keep list immutable
26 lines
796 B
JavaScript
26 lines
796 B
JavaScript
import React from 'react';
|
|
import { shallow } from 'enzyme';
|
|
import { describe, it } from 'mocha';
|
|
import { expect } from 'chai';
|
|
import FilterableTable from '../../../javascripts/components/FilterableTable/FilterableTable';
|
|
import ResultSet from '../../../javascripts/SqlLab/components/ResultSet';
|
|
import { queries } from './fixtures';
|
|
|
|
describe('ResultSet', () => {
|
|
const mockedProps = {
|
|
query: queries[0],
|
|
};
|
|
it('renders', () => {
|
|
expect(React.isValidElement(<ResultSet />)).to.equal(true);
|
|
});
|
|
it('renders with props', () => {
|
|
expect(
|
|
React.isValidElement(<ResultSet />),
|
|
).to.equal(true);
|
|
});
|
|
it('renders a Table', () => {
|
|
const wrapper = shallow(<ResultSet {...mockedProps} />);
|
|
expect(wrapper.find(FilterableTable)).to.have.length(1);
|
|
});
|
|
});
|