mirror of
https://github.com/apache/superset.git
synced 2026-04-12 20:57:55 +00:00
* [lint] turn no-undef back on, set browser, cypress, and mocha env's, and fix issues * [lint] fix undefined var in TimeTable.jsx
29 lines
829 B
JavaScript
29 lines
829 B
JavaScript
import { expect } from 'chai';
|
|
|
|
import { ADD_TOAST, REMOVE_TOAST } from '../../../../src/messageToasts/actions';
|
|
import messageToastsReducer from '../../../../src/messageToasts/reducers';
|
|
|
|
describe('messageToasts reducer', () => {
|
|
it('should return initial state', () => {
|
|
expect(messageToastsReducer(undefined, {})).to.deep.equal([]);
|
|
});
|
|
|
|
it('should add a toast', () => {
|
|
expect(
|
|
messageToastsReducer([], {
|
|
type: ADD_TOAST,
|
|
payload: { text: 'test', id: 'id', type: 'test_type' },
|
|
}),
|
|
).to.deep.equal([{ text: 'test', id: 'id', type: 'test_type' }]);
|
|
});
|
|
|
|
it('should add a toast', () => {
|
|
expect(
|
|
messageToastsReducer([{ id: 'id' }, { id: 'id2' }], {
|
|
type: REMOVE_TOAST,
|
|
payload: { id: 'id' },
|
|
}),
|
|
).to.deep.equal([{ id: 'id2' }]);
|
|
});
|
|
});
|