forked from apache/superset
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Sqllab] Add offline state to sqllab (apache#6013)
* add timeout and refresh for failed backend * show offline state instead of refreshing * add southpane tests
- Loading branch information
1 parent
b9257b2
commit fc3b68e
Showing
12 changed files
with
106 additions
and
17 deletions.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
superset/assets/spec/javascripts/sqllab/SouthPane_spec.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import React from 'react'; | ||
import configureStore from 'redux-mock-store'; | ||
import thunk from 'redux-thunk'; | ||
|
||
import { shallow } from 'enzyme'; | ||
|
||
import { STATUS_OPTIONS } from '../../../src/SqlLab/constants'; | ||
import { initialState } from './fixtures'; | ||
import SouthPane from '../../../src/SqlLab/components/SouthPane'; | ||
|
||
describe('SouthPane', () => { | ||
const middlewares = [thunk]; | ||
const mockStore = configureStore(middlewares); | ||
const store = mockStore(initialState); | ||
|
||
const mockedProps = { | ||
editorQueries: [], | ||
dataPreviewQueries: [], | ||
actions: {}, | ||
activeSouthPaneTab: '', | ||
height: 1, | ||
databases: {}, | ||
offline: false, | ||
}; | ||
|
||
const getWrapper = () => ( | ||
shallow(<SouthPane {...mockedProps} />, { | ||
context: { store }, | ||
}).dive()); | ||
|
||
let wrapper; | ||
it('should render offline when the state is offline', () => { | ||
wrapper = getWrapper(); | ||
wrapper.setProps({ offline: true }); | ||
expect(wrapper.find('.m-r-3').render().text()).toBe(STATUS_OPTIONS.offline); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters