add test coverage for SqlEditorLeftBar (#2984)

This commit is contained in:
Grace Guo
2017-06-19 11:39:32 -07:00
committed by GitHub
parent fc5db474b7
commit 591e512327
3 changed files with 192 additions and 5 deletions

View File

@@ -75,7 +75,7 @@ class SqlEditorLeftBar extends React.PureComponent {
if (dbId && schema) {
this.setState({ tableLoading: true, tableOptions: [] });
const url = `/superset/tables/${dbId}/${schema}/${substr}/`;
$.get(url, (data) => {
$.get(url).done((data) => {
const filterOptions = createFilterOptions({ options: data.options });
this.setState({
filterOptions,
@@ -121,7 +121,7 @@ class SqlEditorLeftBar extends React.PureComponent {
if (actualDbId) {
this.setState({ schemaLoading: true });
const url = `/superset/schemas/${actualDbId}/`;
$.get(url, (data) => {
$.get(url).done((data) => {
const schemaOptions = data.schemas.map(s => ({ value: s, label: s }));
this.setState({ schemaOptions, schemaLoading: false });
})