2021-06-02 22:52:38 +00:00
|
|
|
import { showAlert, showError, showModal, showPrompt } from './ui/components/modals';
|
2021-04-05 15:50:55 +00:00
|
|
|
|
2021-06-02 22:52:38 +00:00
|
|
|
export const getAndClearShowPromptMockArgs = () => {
|
|
|
|
const mockFn = showPrompt as jest.Mock<typeof showPrompt, Parameters<typeof showPrompt>>;
|
|
|
|
const options = mockFn.mock.calls[0][0];
|
2021-04-05 15:50:55 +00:00
|
|
|
mockFn.mockClear();
|
2021-06-02 01:46:26 +00:00
|
|
|
return options;
|
2021-04-05 15:50:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export const getAndClearShowAlertMockArgs = () => {
|
2021-06-02 22:52:38 +00:00
|
|
|
const mockFn = showAlert as jest.Mock<typeof showAlert, Parameters<typeof showAlert>>;
|
2021-08-05 23:30:31 +00:00
|
|
|
const options = mockFn.mock.calls[0][0];
|
2021-04-05 15:50:55 +00:00
|
|
|
mockFn.mockClear();
|
2021-08-05 23:30:31 +00:00
|
|
|
return options;
|
2021-04-05 15:50:55 +00:00
|
|
|
};
|
|
|
|
|
2021-06-02 22:52:38 +00:00
|
|
|
export const getAndClearShowErrorMockArgs = () => {
|
|
|
|
const mockFn = showError as jest.Mock<typeof showError, Parameters<typeof showError>>;
|
|
|
|
const options = mockFn.mock.calls[0][0];
|
2021-04-05 15:50:55 +00:00
|
|
|
mockFn.mockClear();
|
|
|
|
return options;
|
|
|
|
};
|
|
|
|
|
|
|
|
export const getAndClearShowModalMockArgs = () => {
|
2021-06-02 22:52:38 +00:00
|
|
|
const mockFn = showModal as jest.Mock<typeof showModal, Parameters<typeof showModal>>;
|
2021-04-05 15:50:55 +00:00
|
|
|
const args = mockFn.mock.calls[0][1];
|
|
|
|
mockFn.mockClear();
|
|
|
|
return args;
|
|
|
|
};
|