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:
Chris Williams
2018-07-12 11:50:25 -07:00
committed by GitHub
parent f9352af80e
commit 19ac6e1231
72 changed files with 657 additions and 524 deletions

View File

@@ -1,4 +1,5 @@
import React from 'react';
import configureStore from 'redux-mock-store';
import { expect } from 'chai';
import { describe, it } from 'mocha';
import { shallow } from 'enzyme';
@@ -13,11 +14,14 @@ describe('URLShortLinkButton', () => {
emailContent: 'mock content',
};
it('renders', () => {
expect(React.isValidElement(<URLShortLinkButton {...defaultProps} />)).to.equal(true);
});
function setup() {
const mockStore = configureStore([]);
const store = mockStore({});
return shallow(<URLShortLinkButton {...defaultProps} />, { context: { store } }).dive();
}
it('renders OverlayTrigger', () => {
const wrapper = shallow(<URLShortLinkButton {...defaultProps} />);
const wrapper = setup();
expect(wrapper.find(OverlayTrigger)).have.length(1);
});
});