mirror of
https://github.com/apache/superset.git
synced 2026-04-09 03:16:07 +00:00
refactor: typing for explore Control and messageToasts (#11416)
This commit is contained in:
@@ -16,18 +16,17 @@
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
import {
|
||||
DANGER_TOAST,
|
||||
INFO_TOAST,
|
||||
SUCCESS_TOAST,
|
||||
} from 'src/messageToasts/constants';
|
||||
import { ToastType } 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).toMatchObject({ toastType: INFO_TOAST, text: 'info test' });
|
||||
expect(toast).toMatchObject({
|
||||
toastType: ToastType.INFO,
|
||||
text: 'info test',
|
||||
});
|
||||
});
|
||||
|
||||
it('should return a success toast', () => {
|
||||
@@ -35,7 +34,7 @@ describe('getToastsFromPyFlashMessages', () => {
|
||||
['success', 'success test'],
|
||||
])[0];
|
||||
expect(toast).toMatchObject({
|
||||
toastType: SUCCESS_TOAST,
|
||||
toastType: ToastType.SUCCESS,
|
||||
text: 'success test',
|
||||
});
|
||||
});
|
||||
@@ -43,7 +42,7 @@ describe('getToastsFromPyFlashMessages', () => {
|
||||
it('should return a danger toast', () => {
|
||||
const toast = getToastsFromPyFlashMessages([['danger', 'danger test']])[0];
|
||||
expect(toast).toMatchObject({
|
||||
toastType: DANGER_TOAST,
|
||||
toastType: ToastType.DANGER,
|
||||
text: 'danger test',
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user