1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-27 12:56:01 +01:00
metamask-extension/ui/components/app/modals/confirm-reset-account/confirm-reset-account.test.js
amerkadicE 1ecf241a9f
Rename reset account settings (#17457)
* Rename reset account settings

Fix snapshot

Update snapshots

Fix e2e tests

Fix e2e tests

* Rename reset-account e2e test to clear-activity e2e test
2023-02-10 22:50:12 +01:00

42 lines
1.2 KiB
JavaScript

import React from 'react';
import { fireEvent } from '@testing-library/react';
import { renderWithProvider } from '../../../../../test/lib/render-helpers';
import ConfirmResetAccount from '.';
describe('Confirm Reset Account', () => {
const props = {
hideModal: jest.fn(),
resetAccount: jest.fn().mockResolvedValue(),
};
it('should match snapshot', () => {
const { container } = renderWithProvider(
<ConfirmResetAccount.WrappedComponent {...props} />,
);
expect(container).toMatchSnapshot();
});
it('hides modal when nevermind button is clicked', () => {
const { queryByText } = renderWithProvider(
<ConfirmResetAccount.WrappedComponent {...props} />,
);
fireEvent.click(queryByText('[nevermind]'));
expect(props.resetAccount).not.toHaveBeenCalled();
expect(props.hideModal).toHaveBeenCalled();
});
it('resets account and hides modal when reset button is clicked', async () => {
const { queryByText } = renderWithProvider(
<ConfirmResetAccount.WrappedComponent {...props} />,
);
fireEvent.click(queryByText('[clear]'));
expect(props.resetAccount).toHaveBeenCalled();
expect(props.hideModal).toHaveBeenCalled();
});
});