mirror of
https://github.com/apache/superset.git
synced 2026-04-18 23:55:00 +00:00
Bumping the JS libs to fix the build (#2616)
* bumping the js libs * New linting rules * More linting * More * Done linting * npm >=4.5.0 * Bumping node * Tweaking the build * Fixing the damn build * Fixing the apps
This commit is contained in:
committed by
GitHub
parent
a2b30f35fc
commit
366ecefbaa
@@ -1,11 +1,12 @@
|
||||
import React from 'react';
|
||||
import Select from 'react-select';
|
||||
import AsyncSelect from '../../../javascripts/components/AsyncSelect';
|
||||
import { shallow } from 'enzyme';
|
||||
import { describe, it } from 'mocha';
|
||||
import { expect } from 'chai';
|
||||
import sinon from 'sinon';
|
||||
|
||||
import AsyncSelect from '../../../javascripts/components/AsyncSelect';
|
||||
|
||||
describe('AsyncSelect', () => {
|
||||
const mockedProps = {
|
||||
dataEndpoint: '/slicemodelview/api/read',
|
||||
@@ -14,20 +15,20 @@ describe('AsyncSelect', () => {
|
||||
};
|
||||
it('is valid element', () => {
|
||||
expect(
|
||||
React.isValidElement(<AsyncSelect {...mockedProps} />)
|
||||
React.isValidElement(<AsyncSelect {...mockedProps} />),
|
||||
).to.equal(true);
|
||||
});
|
||||
|
||||
it('has one select', () => {
|
||||
const wrapper = shallow(
|
||||
<AsyncSelect {...mockedProps} />
|
||||
<AsyncSelect {...mockedProps} />,
|
||||
);
|
||||
expect(wrapper.find(Select)).to.have.length(1);
|
||||
});
|
||||
|
||||
it('calls onChange on select change', () => {
|
||||
const wrapper = shallow(
|
||||
<AsyncSelect {...mockedProps} />
|
||||
<AsyncSelect {...mockedProps} />,
|
||||
);
|
||||
wrapper.find(Select).simulate('change', { value: 1 });
|
||||
expect(mockedProps.onChange).to.have.property('callCount', 1);
|
||||
|
||||
@@ -11,7 +11,7 @@ describe('CopyToClipboard', () => {
|
||||
|
||||
it('renders', () => {
|
||||
expect(
|
||||
React.isValidElement(<CopyToClipboard {...defaultProps} />)
|
||||
React.isValidElement(<CopyToClipboard {...defaultProps} />),
|
||||
).to.equal(true);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -13,7 +13,7 @@ describe('ModalTrigger', () => {
|
||||
|
||||
it('is a valid element', () => {
|
||||
expect(
|
||||
React.isValidElement(<ModalTrigger {...defaultProps} />)
|
||||
React.isValidElement(<ModalTrigger {...defaultProps} />),
|
||||
).to.equal(true);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import React from 'react';
|
||||
import CodeModal from '../../../javascripts/dashboard/components/CodeModal';
|
||||
import { mount } from 'enzyme';
|
||||
import { describe, it } from 'mocha';
|
||||
import { expect } from 'chai';
|
||||
|
||||
import CodeModal from '../../../javascripts/dashboard/components/CodeModal';
|
||||
|
||||
describe('CodeModal', () => {
|
||||
const mockedProps = {
|
||||
@@ -11,7 +11,7 @@ describe('CodeModal', () => {
|
||||
};
|
||||
it('is valid', () => {
|
||||
expect(
|
||||
React.isValidElement(<CodeModal {...mockedProps} />)
|
||||
React.isValidElement(<CodeModal {...mockedProps} />),
|
||||
).to.equal(true);
|
||||
});
|
||||
it('renders the trigger node', () => {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import React from 'react';
|
||||
import CssEditor from '../../../javascripts/dashboard/components/CssEditor';
|
||||
import { mount } from 'enzyme';
|
||||
import { describe, it } from 'mocha';
|
||||
import { expect } from 'chai';
|
||||
|
||||
import CssEditor from '../../../javascripts/dashboard/components/CssEditor';
|
||||
|
||||
describe('CssEditor', () => {
|
||||
const mockedProps = {
|
||||
@@ -11,7 +11,7 @@ describe('CssEditor', () => {
|
||||
};
|
||||
it('is valid', () => {
|
||||
expect(
|
||||
React.isValidElement(<CssEditor {...mockedProps} />)
|
||||
React.isValidElement(<CssEditor {...mockedProps} />),
|
||||
).to.equal(true);
|
||||
});
|
||||
it('renders the trigger node', () => {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import React from 'react';
|
||||
import RefreshIntervalModal from '../../../javascripts/dashboard/components/RefreshIntervalModal';
|
||||
import { mount } from 'enzyme';
|
||||
import { describe, it } from 'mocha';
|
||||
import { expect } from 'chai';
|
||||
|
||||
import RefreshIntervalModal from '../../../javascripts/dashboard/components/RefreshIntervalModal';
|
||||
|
||||
describe('RefreshIntervalModal', () => {
|
||||
const mockedProps = {
|
||||
@@ -11,7 +11,7 @@ describe('RefreshIntervalModal', () => {
|
||||
};
|
||||
it('is valid', () => {
|
||||
expect(
|
||||
React.isValidElement(<RefreshIntervalModal {...mockedProps} />)
|
||||
React.isValidElement(<RefreshIntervalModal {...mockedProps} />),
|
||||
).to.equal(true);
|
||||
});
|
||||
it('renders the trigger node', () => {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import React from 'react';
|
||||
import SliceCell from '../../../javascripts/dashboard/components/SliceCell';
|
||||
import { mount } from 'enzyme';
|
||||
import { describe, it } from 'mocha';
|
||||
import { expect } from 'chai';
|
||||
import { slice } from './fixtures';
|
||||
|
||||
import SliceCell from '../../../javascripts/dashboard/components/SliceCell';
|
||||
|
||||
describe('SliceCell', () => {
|
||||
const mockedProps = {
|
||||
@@ -14,7 +14,7 @@ describe('SliceCell', () => {
|
||||
};
|
||||
it('is valid', () => {
|
||||
expect(
|
||||
React.isValidElement(<SliceCell {...mockedProps} />)
|
||||
React.isValidElement(<SliceCell {...mockedProps} />),
|
||||
).to.equal(true);
|
||||
});
|
||||
it('renders five links', () => {
|
||||
|
||||
@@ -5,6 +5,7 @@ import sinon from 'sinon';
|
||||
import { expect } from 'chai';
|
||||
import { describe, it, beforeEach } from 'mocha';
|
||||
import { shallow } from 'enzyme';
|
||||
|
||||
import CheckboxControl from '../../../../javascripts/explorev2/components/controls/CheckboxControl';
|
||||
|
||||
const defaultProps = {
|
||||
@@ -18,7 +18,7 @@ describe('ExploreActionButtons', () => {
|
||||
|
||||
it('renders', () => {
|
||||
expect(
|
||||
React.isValidElement(<ExploreActionButtons {...defaultProps} />)
|
||||
React.isValidElement(<ExploreActionButtons {...defaultProps} />),
|
||||
).to.equal(true);
|
||||
});
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ describe('FilterControl', () => {
|
||||
|
||||
it('renders Filters', () => {
|
||||
expect(
|
||||
React.isValidElement(<FilterControl {...defaultProps} />)
|
||||
React.isValidElement(<FilterControl {...defaultProps} />),
|
||||
).to.equal(true);
|
||||
});
|
||||
|
||||
@@ -34,7 +34,7 @@ describe('Filter', () => {
|
||||
|
||||
it('renders Filters', () => {
|
||||
expect(
|
||||
React.isValidElement(<Filter {...defaultProps} />)
|
||||
React.isValidElement(<Filter {...defaultProps} />),
|
||||
).to.equal(true);
|
||||
});
|
||||
|
||||
@@ -24,7 +24,7 @@ describe('RunQueryActionButton', () => {
|
||||
|
||||
it('is a valid react element', () => {
|
||||
expect(
|
||||
React.isValidElement(<RunQueryActionButton {...defaultProps} />)
|
||||
React.isValidElement(<RunQueryActionButton {...defaultProps} />),
|
||||
).to.equal(true);
|
||||
});
|
||||
|
||||
@@ -2,11 +2,12 @@ import React from 'react';
|
||||
import { expect } from 'chai';
|
||||
import { describe, it, beforeEach } from 'mocha';
|
||||
import { shallow } from 'enzyme';
|
||||
import { defaultFormData } from '../../../../javascripts/explorev2/stores/store';
|
||||
import { SaveModal } from '../../../../javascripts/explorev2/components/SaveModal';
|
||||
import { Modal, Button, Radio } from 'react-bootstrap';
|
||||
import sinon from 'sinon';
|
||||
|
||||
import { defaultFormData } from '../../../../javascripts/explorev2/stores/store';
|
||||
import { SaveModal } from '../../../../javascripts/explorev2/components/SaveModal';
|
||||
|
||||
const defaultProps = {
|
||||
can_edit: true,
|
||||
onHide: () => ({}),
|
||||
@@ -1,7 +1,7 @@
|
||||
import { it, describe } from 'mocha';
|
||||
import { expect } from 'chai';
|
||||
import URI from 'urijs';
|
||||
import { getExploreUrl } from '../../../javascripts/explorev2/exploreUtils.js';
|
||||
import { getExploreUrl } from '../../../javascripts/explorev2/exploreUtils';
|
||||
|
||||
describe('utils', () => {
|
||||
const formData = {
|
||||
@@ -19,41 +19,41 @@ describe('utils', () => {
|
||||
|
||||
compareURI(
|
||||
URI(getExploreUrl(formData, 'base', false, 'http://superset.com')),
|
||||
URI('/superset/explore/table/1/').search({ form_data: sFormData })
|
||||
URI('/superset/explore/table/1/').search({ form_data: sFormData }),
|
||||
);
|
||||
});
|
||||
it('getExploreUrl generates proper json url', () => {
|
||||
compareURI(
|
||||
URI(getExploreUrl(formData, 'json', false, 'superset.com')),
|
||||
URI('/superset/explore_json/table/1/').search({ form_data: sFormData })
|
||||
URI('/superset/explore_json/table/1/').search({ form_data: sFormData }),
|
||||
);
|
||||
});
|
||||
it('getExploreUrl generates proper json forced url', () => {
|
||||
compareURI(
|
||||
URI(getExploreUrl(formData, 'json', true, 'superset.com')),
|
||||
URI('/superset/explore_json/table/1/')
|
||||
.search({ form_data: sFormData, force: 'true' })
|
||||
.search({ form_data: sFormData, force: 'true' }),
|
||||
);
|
||||
});
|
||||
it('getExploreUrl generates proper csv URL', () => {
|
||||
compareURI(
|
||||
URI(getExploreUrl(formData, 'csv', false, 'superset.com')),
|
||||
URI('/superset/explore_json/table/1/')
|
||||
.search({ form_data: sFormData, csv: 'true' })
|
||||
.search({ form_data: sFormData, csv: 'true' }),
|
||||
);
|
||||
});
|
||||
it('getExploreUrl generates proper standalone URL', () => {
|
||||
compareURI(
|
||||
URI(getExploreUrl(formData, 'standalone', false, 'superset.com')),
|
||||
URI('/superset/explore/table/1/')
|
||||
.search({ form_data: sFormData, standalone: 'true' })
|
||||
.search({ form_data: sFormData, standalone: 'true' }),
|
||||
);
|
||||
});
|
||||
it('getExploreUrl preserves main URLs params', () => {
|
||||
compareURI(
|
||||
URI(getExploreUrl(formData, 'json', false, 'superset.com?foo=bar')),
|
||||
URI('/superset/explore_json/table/1/')
|
||||
.search({ foo: 'bar', form_data: sFormData })
|
||||
.search({ foo: 'bar', form_data: sFormData }),
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import React from 'react';
|
||||
import App from '../../../javascripts/profile/components/App';
|
||||
import { Col, Row, Tab } from 'react-bootstrap';
|
||||
import { mount } from 'enzyme';
|
||||
import { describe, it } from 'mocha';
|
||||
import { expect } from 'chai';
|
||||
|
||||
import { user } from './fixtures';
|
||||
import App from '../../../javascripts/profile/components/App';
|
||||
|
||||
describe('App', () => {
|
||||
const mockedProps = {
|
||||
@@ -12,7 +13,7 @@ describe('App', () => {
|
||||
};
|
||||
it('is valid', () => {
|
||||
expect(
|
||||
React.isValidElement(<App {...mockedProps} />)
|
||||
React.isValidElement(<App {...mockedProps} />),
|
||||
).to.equal(true);
|
||||
});
|
||||
it('renders 2 Col', () => {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import React from 'react';
|
||||
import CreatedContent from '../../../javascripts/profile/components/CreatedContent';
|
||||
import TableLoader from '../../../javascripts/profile/components/TableLoader';
|
||||
import { mount } from 'enzyme';
|
||||
import { describe, it } from 'mocha';
|
||||
import { expect } from 'chai';
|
||||
import { user } from './fixtures';
|
||||
import CreatedContent from '../../../javascripts/profile/components/CreatedContent';
|
||||
import TableLoader from '../../../javascripts/profile/components/TableLoader';
|
||||
|
||||
|
||||
describe('CreatedContent', () => {
|
||||
@@ -13,7 +13,7 @@ describe('CreatedContent', () => {
|
||||
};
|
||||
it('is valid', () => {
|
||||
expect(
|
||||
React.isValidElement(<CreatedContent {...mockedProps} />)
|
||||
React.isValidElement(<CreatedContent {...mockedProps} />),
|
||||
).to.equal(true);
|
||||
});
|
||||
it('renders 2 TableLoader', () => {
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import React from 'react';
|
||||
import Favorites from '../../../javascripts/profile/components/Favorites';
|
||||
import TableLoader from '../../../javascripts/profile/components/TableLoader';
|
||||
import { mount } from 'enzyme';
|
||||
import { describe, it } from 'mocha';
|
||||
import { expect } from 'chai';
|
||||
|
||||
import { user } from './fixtures';
|
||||
import Favorites from '../../../javascripts/profile/components/Favorites';
|
||||
import TableLoader from '../../../javascripts/profile/components/TableLoader';
|
||||
|
||||
describe('Favorites', () => {
|
||||
const mockedProps = {
|
||||
@@ -12,7 +13,7 @@ describe('Favorites', () => {
|
||||
};
|
||||
it('is valid', () => {
|
||||
expect(
|
||||
React.isValidElement(<Favorites {...mockedProps} />)
|
||||
React.isValidElement(<Favorites {...mockedProps} />),
|
||||
).to.equal(true);
|
||||
});
|
||||
it('renders 2 TableLoader', () => {
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import React from 'react';
|
||||
import RecentActivity from '../../../javascripts/profile/components/RecentActivity';
|
||||
import TableLoader from '../../../javascripts/profile/components/TableLoader';
|
||||
import { mount } from 'enzyme';
|
||||
import { describe, it } from 'mocha';
|
||||
import { expect } from 'chai';
|
||||
|
||||
import { user } from './fixtures';
|
||||
import RecentActivity from '../../../javascripts/profile/components/RecentActivity';
|
||||
import TableLoader from '../../../javascripts/profile/components/TableLoader';
|
||||
|
||||
|
||||
describe('RecentActivity', () => {
|
||||
@@ -13,7 +14,7 @@ describe('RecentActivity', () => {
|
||||
};
|
||||
it('is valid', () => {
|
||||
expect(
|
||||
React.isValidElement(<RecentActivity {...mockedProps} />)
|
||||
React.isValidElement(<RecentActivity {...mockedProps} />),
|
||||
).to.equal(true);
|
||||
});
|
||||
it('renders a TableLoader', () => {
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import React from 'react';
|
||||
import Security from '../../../javascripts/profile/components/Security';
|
||||
import { mount } from 'enzyme';
|
||||
import { describe, it } from 'mocha';
|
||||
import { expect } from 'chai';
|
||||
|
||||
import { user, userNoPerms } from './fixtures';
|
||||
import Security from '../../../javascripts/profile/components/Security';
|
||||
|
||||
|
||||
describe('Security', () => {
|
||||
@@ -12,7 +13,7 @@ describe('Security', () => {
|
||||
};
|
||||
it('is valid', () => {
|
||||
expect(
|
||||
React.isValidElement(<Security {...mockedProps} />)
|
||||
React.isValidElement(<Security {...mockedProps} />),
|
||||
).to.equal(true);
|
||||
});
|
||||
it('renders 2 role labels', () => {
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
import React from 'react';
|
||||
import UserInfo from '../../../javascripts/profile/components/UserInfo';
|
||||
import Gravatar from 'react-gravatar';
|
||||
import { Panel } from 'react-bootstrap';
|
||||
import { mount } from 'enzyme';
|
||||
import { describe, it } from 'mocha';
|
||||
import { expect } from 'chai';
|
||||
|
||||
import { user } from './fixtures';
|
||||
import UserInfo from '../../../javascripts/profile/components/UserInfo';
|
||||
|
||||
|
||||
describe('UserInfo', () => {
|
||||
@@ -14,7 +15,7 @@ describe('UserInfo', () => {
|
||||
};
|
||||
it('is valid', () => {
|
||||
expect(
|
||||
React.isValidElement(<UserInfo {...mockedProps} />)
|
||||
React.isValidElement(<UserInfo {...mockedProps} />),
|
||||
).to.equal(true);
|
||||
});
|
||||
it('renders a Gravatar', () => {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import React from 'react';
|
||||
import AlertsWrapper from '../../../javascripts/components/AlertsWrapper';
|
||||
import { describe, it } from 'mocha';
|
||||
import { expect } from 'chai';
|
||||
|
||||
import AlertsWrapper from '../../../javascripts/components/AlertsWrapper';
|
||||
|
||||
describe('AlertsWrapper', () => {
|
||||
it('is valid', () => {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import React from 'react';
|
||||
import App from '../../../javascripts/SqlLab/components/App';
|
||||
import { describe, it } from 'mocha';
|
||||
import { expect } from 'chai';
|
||||
|
||||
import App from '../../../javascripts/SqlLab/components/App';
|
||||
|
||||
describe('App', () => {
|
||||
it('is valid', () => {
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import React from 'react';
|
||||
import ColumnElement from '../../../javascripts/SqlLab/components/ColumnElement';
|
||||
import { mockedActions, table } from './fixtures';
|
||||
import { mount } from 'enzyme';
|
||||
import { describe, it } from 'mocha';
|
||||
import { expect } from 'chai';
|
||||
|
||||
import { mockedActions, table } from './fixtures';
|
||||
import ColumnElement from '../../../javascripts/SqlLab/components/ColumnElement';
|
||||
|
||||
|
||||
describe('ColumnElement', () => {
|
||||
const mockedProps = {
|
||||
@@ -13,7 +14,7 @@ describe('ColumnElement', () => {
|
||||
};
|
||||
it('is valid with props', () => {
|
||||
expect(
|
||||
React.isValidElement(<ColumnElement {...mockedProps} />)
|
||||
React.isValidElement(<ColumnElement {...mockedProps} />),
|
||||
).to.equal(true);
|
||||
});
|
||||
it('renders a proper primary key', () => {
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
import React from 'react';
|
||||
import CopyQueryTabUrl from '../../../javascripts/SqlLab/components/CopyQueryTabUrl';
|
||||
import { describe, it } from 'mocha';
|
||||
import { expect } from 'chai';
|
||||
import { initialState } from './fixtures';
|
||||
|
||||
import CopyQueryTabUrl from '../../../javascripts/SqlLab/components/CopyQueryTabUrl';
|
||||
|
||||
describe('CopyQueryTabUrl', () => {
|
||||
const mockedProps = {
|
||||
queryEditor: initialState.queryEditors[0],
|
||||
};
|
||||
it('is valid with props', () => {
|
||||
expect(
|
||||
React.isValidElement(<CopyQueryTabUrl {...mockedProps} />)
|
||||
React.isValidElement(<CopyQueryTabUrl {...mockedProps} />),
|
||||
).to.equal(true);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
import React from 'react';
|
||||
import HighlightedSql from '../../../javascripts/SqlLab/components/HighlightedSql';
|
||||
import ModalTrigger from '../../../javascripts/components/ModalTrigger';
|
||||
import SyntaxHighlighter from 'react-syntax-highlighter';
|
||||
import { mount, shallow } from 'enzyme';
|
||||
import { describe, it } from 'mocha';
|
||||
import { expect } from 'chai';
|
||||
|
||||
import HighlightedSql from '../../../javascripts/SqlLab/components/HighlightedSql';
|
||||
import ModalTrigger from '../../../javascripts/components/ModalTrigger';
|
||||
|
||||
|
||||
describe('HighlightedSql', () => {
|
||||
const sql = "SELECT * FROM test WHERE something='fkldasjfklajdslfkjadlskfjkldasjfkladsjfkdjsa'";
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import React from 'react';
|
||||
import Link from '../../../javascripts/SqlLab/components/Link';
|
||||
import { shallow } from 'enzyme';
|
||||
import { describe, it } from 'mocha';
|
||||
import { expect } from 'chai';
|
||||
|
||||
import Link from '../../../javascripts/SqlLab/components/Link';
|
||||
|
||||
describe('Link', () => {
|
||||
const mockedProps = {
|
||||
@@ -15,7 +15,7 @@ describe('Link', () => {
|
||||
});
|
||||
it('renders with props', () => {
|
||||
expect(
|
||||
React.isValidElement(<Link {...mockedProps} >TEST</Link>)
|
||||
React.isValidElement(<Link {...mockedProps} >TEST</Link>),
|
||||
).to.equal(true);
|
||||
});
|
||||
it('renders an anchor tag', () => {
|
||||
|
||||
@@ -1,19 +1,20 @@
|
||||
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';
|
||||
import sinon from 'sinon';
|
||||
|
||||
import QuerySearch from '../../../javascripts/SqlLab/components/QuerySearch';
|
||||
|
||||
describe('QuerySearch', () => {
|
||||
const mockedProps = {
|
||||
actions: {},
|
||||
};
|
||||
it('is valid', () => {
|
||||
expect(
|
||||
React.isValidElement(<QuerySearch {...mockedProps} />)
|
||||
React.isValidElement(<QuerySearch {...mockedProps} />),
|
||||
).to.equal(true);
|
||||
});
|
||||
const wrapper = shallow(<QuerySearch {...mockedProps} />);
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import React from 'react';
|
||||
import QueryTable from '../../../javascripts/SqlLab/components/QueryTable';
|
||||
import { queries } from './fixtures';
|
||||
import { mount } from 'enzyme';
|
||||
import { describe, it } from 'mocha';
|
||||
import { expect } from 'chai';
|
||||
|
||||
import { queries } from './fixtures';
|
||||
import QueryTable from '../../../javascripts/SqlLab/components/QueryTable';
|
||||
|
||||
|
||||
describe('QueryTable', () => {
|
||||
const mockedProps = {
|
||||
@@ -15,7 +16,7 @@ describe('QueryTable', () => {
|
||||
});
|
||||
it('is valid with props', () => {
|
||||
expect(
|
||||
React.isValidElement(<QueryTable {...mockedProps} />)
|
||||
React.isValidElement(<QueryTable {...mockedProps} />),
|
||||
).to.equal(true);
|
||||
});
|
||||
it('renders a proper table', () => {
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
import React from 'react';
|
||||
import ResultSet from '../../../javascripts/SqlLab/components/ResultSet';
|
||||
import { shallow } from 'enzyme';
|
||||
import { describe, it } from 'mocha';
|
||||
import { expect } from 'chai';
|
||||
import { queries } from './fixtures';
|
||||
import { Table } from 'reactable';
|
||||
|
||||
import ResultSet from '../../../javascripts/SqlLab/components/ResultSet';
|
||||
import { queries } from './fixtures';
|
||||
|
||||
describe('ResultSet', () => {
|
||||
const mockedProps = {
|
||||
query: queries[0],
|
||||
@@ -15,7 +16,7 @@ describe('ResultSet', () => {
|
||||
});
|
||||
it('renders with props', () => {
|
||||
expect(
|
||||
React.isValidElement(<ResultSet />)
|
||||
React.isValidElement(<ResultSet />),
|
||||
).to.equal(true);
|
||||
});
|
||||
it('renders a Table', () => {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import React from 'react';
|
||||
import SaveQuery from '../../../javascripts/SqlLab/components/SaveQuery';
|
||||
import { Overlay, Popover, FormControl } from 'react-bootstrap';
|
||||
import { shallow, mount } from 'enzyme';
|
||||
import { describe, it } from 'mocha';
|
||||
import { expect } from 'chai';
|
||||
|
||||
import SaveQuery from '../../../javascripts/SqlLab/components/SaveQuery';
|
||||
|
||||
describe('SavedQuery', () => {
|
||||
const mockedProps = {
|
||||
@@ -16,12 +16,12 @@ describe('SavedQuery', () => {
|
||||
};
|
||||
it('is valid', () => {
|
||||
expect(
|
||||
React.isValidElement(<SaveQuery />)
|
||||
React.isValidElement(<SaveQuery />),
|
||||
).to.equal(true);
|
||||
});
|
||||
it('is valid with props', () => {
|
||||
expect(
|
||||
React.isValidElement(<SaveQuery {...mockedProps} />)
|
||||
React.isValidElement(<SaveQuery {...mockedProps} />),
|
||||
).to.equal(true);
|
||||
});
|
||||
it('has an Overlay and a Popover', () => {
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
import React from 'react';
|
||||
import SqlEditorLeftBar from '../../../javascripts/SqlLab/components/SqlEditorLeftBar';
|
||||
import TableElement from '../../../javascripts/SqlLab/components/TableElement';
|
||||
import { mount } from 'enzyme';
|
||||
import { table, defaultQueryEditor } from './fixtures';
|
||||
import { describe, it } from 'mocha';
|
||||
import { expect } from 'chai';
|
||||
|
||||
import { table, defaultQueryEditor } from './fixtures';
|
||||
import SqlEditorLeftBar from '../../../javascripts/SqlLab/components/SqlEditorLeftBar';
|
||||
import TableElement from '../../../javascripts/SqlLab/components/TableElement';
|
||||
|
||||
|
||||
describe('SqlEditorLeftBar', () => {
|
||||
const mockedProps = {
|
||||
@@ -14,7 +15,7 @@ describe('SqlEditorLeftBar', () => {
|
||||
};
|
||||
it('is valid', () => {
|
||||
expect(
|
||||
React.isValidElement(<SqlEditorLeftBar {...mockedProps} />)
|
||||
React.isValidElement(<SqlEditorLeftBar {...mockedProps} />),
|
||||
).to.equal(true);
|
||||
});
|
||||
it('renders a TableElement', () => {
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import React from 'react';
|
||||
import SqlEditor from '../../../javascripts/SqlLab/components/SqlEditor';
|
||||
import SqlEditorLeftBar from '../../../javascripts/SqlLab/components/SqlEditorLeftBar';
|
||||
import { shallow } from 'enzyme';
|
||||
import { describe, it } from 'mocha';
|
||||
import { expect } from 'chai';
|
||||
|
||||
import { initialState, queries, table } from './fixtures';
|
||||
import SqlEditor from '../../../javascripts/SqlLab/components/SqlEditor';
|
||||
import SqlEditorLeftBar from '../../../javascripts/SqlLab/components/SqlEditorLeftBar';
|
||||
|
||||
describe('SqlEditor', () => {
|
||||
const mockedProps = {
|
||||
@@ -17,7 +18,7 @@ describe('SqlEditor', () => {
|
||||
};
|
||||
it('is valid', () => {
|
||||
expect(
|
||||
React.isValidElement(<SqlEditor {...mockedProps} />)
|
||||
React.isValidElement(<SqlEditor {...mockedProps} />),
|
||||
).to.equal(true);
|
||||
});
|
||||
it('render a SqlEditorLeftBar', () => {
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import React from 'react';
|
||||
import { TabbedSqlEditors } from '../../../javascripts/SqlLab/components/TabbedSqlEditors';
|
||||
import { Tab } from 'react-bootstrap';
|
||||
import { shallow } from 'enzyme';
|
||||
import { describe, it } from 'mocha';
|
||||
import { expect } from 'chai';
|
||||
|
||||
import { initialState } from './fixtures';
|
||||
import { TabbedSqlEditors } from '../../../javascripts/SqlLab/components/TabbedSqlEditors';
|
||||
|
||||
describe('TabbedSqlEditors', () => {
|
||||
const mockedProps = {
|
||||
@@ -17,7 +18,7 @@ describe('TabbedSqlEditors', () => {
|
||||
};
|
||||
it('is valid', () => {
|
||||
expect(
|
||||
React.isValidElement(<TabbedSqlEditors {...mockedProps} />)
|
||||
React.isValidElement(<TabbedSqlEditors {...mockedProps} />),
|
||||
).to.equal(true);
|
||||
});
|
||||
it('shallow mounts', () => {
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import React from 'react';
|
||||
import Link from '../../../javascripts/SqlLab/components/Link';
|
||||
import TableElement from '../../../javascripts/SqlLab/components/TableElement';
|
||||
import ColumnElement from '../../../javascripts/SqlLab/components/ColumnElement';
|
||||
import { mockedActions, table } from './fixtures';
|
||||
import { mount, shallow } from 'enzyme';
|
||||
import { describe, it } from 'mocha';
|
||||
import { expect } from 'chai';
|
||||
|
||||
import Link from '../../../javascripts/SqlLab/components/Link';
|
||||
import TableElement from '../../../javascripts/SqlLab/components/TableElement';
|
||||
import ColumnElement from '../../../javascripts/SqlLab/components/ColumnElement';
|
||||
import { mockedActions, table } from './fixtures';
|
||||
|
||||
describe('TableElement', () => {
|
||||
const mockedProps = {
|
||||
@@ -16,12 +16,12 @@ describe('TableElement', () => {
|
||||
};
|
||||
it('renders', () => {
|
||||
expect(
|
||||
React.isValidElement(<TableElement />)
|
||||
React.isValidElement(<TableElement />),
|
||||
).to.equal(true);
|
||||
});
|
||||
it('renders with props', () => {
|
||||
expect(
|
||||
React.isValidElement(<TableElement {...mockedProps} />)
|
||||
React.isValidElement(<TableElement {...mockedProps} />),
|
||||
).to.equal(true);
|
||||
});
|
||||
it('has 2 Link elements', () => {
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import React from 'react';
|
||||
import Timer from '../../../javascripts/components/Timer';
|
||||
import { shallow } from 'enzyme';
|
||||
import { describe, it } from 'mocha';
|
||||
import { expect } from 'chai';
|
||||
|
||||
import Timer from '../../../javascripts/components/Timer';
|
||||
import { now } from '../../../javascripts/modules/dates';
|
||||
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import React from 'react';
|
||||
import VisualizeModal from '../../../javascripts/SqlLab/components/VisualizeModal';
|
||||
import { queries } from './fixtures';
|
||||
import { Modal } from 'react-bootstrap';
|
||||
import { shallow } from 'enzyme';
|
||||
import { describe, it } from 'mocha';
|
||||
import { expect } from 'chai';
|
||||
|
||||
import { queries } from './fixtures';
|
||||
import VisualizeModal from '../../../javascripts/SqlLab/components/VisualizeModal';
|
||||
|
||||
describe('VisualizeModal', () => {
|
||||
const mockedProps = {
|
||||
@@ -17,7 +17,7 @@ describe('VisualizeModal', () => {
|
||||
});
|
||||
it('renders with props', () => {
|
||||
expect(
|
||||
React.isValidElement(<VisualizeModal {...mockedProps} />)
|
||||
React.isValidElement(<VisualizeModal {...mockedProps} />),
|
||||
).to.equal(true);
|
||||
});
|
||||
it('renders a Modal', () => {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import * as actions from '../../../javascripts/SqlLab/actions';
|
||||
import sinon from 'sinon';
|
||||
import * as actions from '../../../javascripts/SqlLab/actions';
|
||||
|
||||
export const mockedActions = sinon.stub(Object.assign({}, actions));
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import * as r from '../../../javascripts/SqlLab/reducers';
|
||||
import * as actions from '../../../javascripts/SqlLab/actions';
|
||||
import { beforeEach, describe, it } from 'mocha';
|
||||
import { expect } from 'chai';
|
||||
|
||||
import * as r from '../../../javascripts/SqlLab/reducers';
|
||||
import * as actions from '../../../javascripts/SqlLab/actions';
|
||||
import { alert, table, initialState } from './fixtures';
|
||||
|
||||
describe('sqlLabReducer', () => {
|
||||
|
||||
Reference in New Issue
Block a user