Skip to content

Commit

Permalink
Fix test's warnings (#2697)
Browse files Browse the repository at this point in the history
* tests: adding required props to FilterableTable mockedProps

* tests: adding required prop `height` to QuerySearch mockedProps

* tests: adding required prop `height` to ResultSet mockedProps

* tests: adding required prop `height` to SqlEditorLeftBar mockedProps

* tests: fix warning in Timer component
  • Loading branch information
dennybiasiolli authored and mistercrunch committed Apr 30, 2017
1 parent a58adc8 commit 3cd16cf
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ import { expect } from 'chai';
import FilterableTable from '../../../../javascripts/components/FilterableTable/FilterableTable';

describe('FilterableTable', () => {
const mockedProps = {
orderedColumnKeys: [],
data: [],
height: 0,
};
it('is valid element', () => {
expect(React.isValidElement(<FilterableTable />)).to.equal(true);
expect(React.isValidElement(<FilterableTable {...mockedProps} />)).to.equal(true);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import QuerySearch from '../../../javascripts/SqlLab/components/QuerySearch';
describe('QuerySearch', () => {
const mockedProps = {
actions: {},
height: 0,
};
it('is valid', () => {
expect(
Expand Down
10 changes: 3 additions & 7 deletions superset/assets/spec/javascripts/sqllab/ResultSet_spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,10 @@ import { queries } from './fixtures';
describe('ResultSet', () => {
const mockedProps = {
query: queries[0],
height: 0,
};
it('renders', () => {
expect(React.isValidElement(<ResultSet />)).to.equal(true);
});
it('renders with props', () => {
expect(
React.isValidElement(<ResultSet />),
).to.equal(true);
it('is valid', () => {
expect(React.isValidElement(<ResultSet {...mockedProps} />)).to.equal(true);
});
it('renders a Table', () => {
const wrapper = shallow(<ResultSet {...mockedProps} />);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ describe('SqlEditorLeftBar', () => {
const mockedProps = {
tables: [table],
queryEditor: defaultQueryEditor,
height: 0,
};
it('is valid', () => {
expect(
Expand Down
5 changes: 1 addition & 4 deletions superset/assets/spec/javascripts/sqllab/Timer_spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@ describe('Timer', () => {
isRunning: true,
state: 'warning',
};
it('renders', () => {
expect(React.isValidElement(<Timer />)).to.equal(true);
});
it('renders with props', () => {
it('is valid', () => {
expect(React.isValidElement(<Timer {...mockedProps} />))
.to.equal(true);
});
Expand Down

0 comments on commit 3cd16cf

Please sign in to comment.