mirror of
https://github.com/apache/superset.git
synced 2026-04-19 16:14:52 +00:00
get rid of global notify (#5355)
* [toasts] get rid of notify globals, refactor messageToasts for use by entire app * [remove notify] use arrow func in ajax call * fix lint + tests * actually fix tests from messageToast refactor * add 'test:one' npm script * debugger * [toasts] convert bootstrap flash messages to toasts in explore + sqllab * [toasts][tests] import from right file
This commit is contained in:
@@ -14,23 +14,24 @@ import { sqlLabReducer } from '../../../src/SqlLab/reducers';
|
||||
describe('App', () => {
|
||||
const middlewares = [thunk];
|
||||
const mockStore = configureStore(middlewares);
|
||||
const store = mockStore(sqlLabReducer(undefined, {}));
|
||||
const store = mockStore({ sqlLab: sqlLabReducer(undefined, {}), messageToasts: [] });
|
||||
|
||||
let wrapper;
|
||||
beforeEach(() => {
|
||||
wrapper = shallow(<App />, {
|
||||
context: { store },
|
||||
}).dive();
|
||||
wrapper = shallow(<App />, { context: { store } }).dive();
|
||||
});
|
||||
|
||||
it('is valid', () => {
|
||||
expect(React.isValidElement(<App />)).to.equal(true);
|
||||
});
|
||||
|
||||
it('should handler resize', () => {
|
||||
sinon.spy(wrapper.instance(), 'getHeight');
|
||||
wrapper.instance().handleResize();
|
||||
expect(wrapper.instance().getHeight.callCount).to.equal(1);
|
||||
wrapper.instance().getHeight.restore();
|
||||
});
|
||||
|
||||
it('should render', () => {
|
||||
expect(wrapper.find('.SqlLab')).to.have.length(1);
|
||||
expect(wrapper.find(TabbedSqlEditors)).to.have.length(1);
|
||||
|
||||
Reference in New Issue
Block a user