mirror of
https://github.com/apache/superset.git
synced 2026-04-18 15:44:57 +00:00
committed by
GitHub
parent
0fc9da6be7
commit
0c08bb87c3
@@ -19,6 +19,7 @@
|
||||
import React from 'react';
|
||||
import { mount } from 'enzyme';
|
||||
import Button from 'src/components/Button';
|
||||
import { act } from 'react-dom/test-utils';
|
||||
import { supersetTheme, ThemeProvider } from '@superset-ui/core';
|
||||
import ConfirmStatusChange from 'src/components/ConfirmStatusChange';
|
||||
import Modal from 'src/common/components/Modal';
|
||||
@@ -44,7 +45,9 @@ describe('ConfirmStatusChange', () => {
|
||||
);
|
||||
|
||||
it('opens a confirm modal', () => {
|
||||
wrapper.find('#btn1').first().props().onClick('foo');
|
||||
act(() => {
|
||||
wrapper.find('#btn1').first().props().onClick('foo');
|
||||
});
|
||||
|
||||
wrapper.update();
|
||||
|
||||
@@ -52,7 +55,9 @@ describe('ConfirmStatusChange', () => {
|
||||
});
|
||||
|
||||
it('calls the function on confirm', () => {
|
||||
wrapper.find(Button).last().props().onClick();
|
||||
act(() => {
|
||||
wrapper.find(Button).last().props().onClick();
|
||||
});
|
||||
|
||||
expect(mockedProps.onConfirm).toHaveBeenCalledWith('foo');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user