mirror of
https://github.com/apache/superset.git
synced 2026-04-08 19:05:46 +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
35 lines
995 B
JavaScript
35 lines
995 B
JavaScript
import { expect } from 'chai';
|
|
|
|
import {
|
|
DANGER_TOAST,
|
|
INFO_TOAST,
|
|
SUCCESS_TOAST,
|
|
} from '../../../../src/messageToasts/constants';
|
|
|
|
import getToastsFromPyFlashMessages from '../../../../src/messageToasts/utils/getToastsFromPyFlashMessages';
|
|
|
|
describe('getToastsFromPyFlashMessages', () => {
|
|
it('should return an info toast', () => {
|
|
const toast = getToastsFromPyFlashMessages([['info', 'info test']])[0];
|
|
expect(toast).to.deep.include({ toastType: INFO_TOAST, text: 'info test' });
|
|
});
|
|
|
|
it('should return a success toast', () => {
|
|
const toast = getToastsFromPyFlashMessages([
|
|
['success', 'success test'],
|
|
])[0];
|
|
expect(toast).to.deep.include({
|
|
toastType: SUCCESS_TOAST,
|
|
text: 'success test',
|
|
});
|
|
});
|
|
|
|
it('should return a danger toast', () => {
|
|
const toast = getToastsFromPyFlashMessages([['danger', 'danger test']])[0];
|
|
expect(toast).to.deep.include({
|
|
toastType: DANGER_TOAST,
|
|
text: 'danger test',
|
|
});
|
|
});
|
|
});
|