mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-12 12:47:14 +01:00
06450a4056
* Convert End of Flow test to tlr. * Convert Select Action test to tlr * Convert Metametrics opt in test to tlr
28 lines
875 B
JavaScript
28 lines
875 B
JavaScript
import React from 'react';
|
|
import sinon from 'sinon';
|
|
import { fireEvent, screen } from '@testing-library/react';
|
|
import { renderWithProvider } from '../../../../test/lib/render-helpers';
|
|
import MetaMetricsOptIn from './metametrics-opt-in.container';
|
|
|
|
describe('MetaMetricsOptIn', () => {
|
|
it('opt out of MetaMetrics', () => {
|
|
afterEach(() => {
|
|
sinon.resetHistory();
|
|
});
|
|
const props = {
|
|
history: {
|
|
push: sinon.spy(),
|
|
},
|
|
setParticipateInMetaMetrics: sinon.stub().resolves(),
|
|
participateInMetaMetrics: false,
|
|
};
|
|
renderWithProvider(<MetaMetricsOptIn.WrappedComponent {...props} />);
|
|
|
|
const noThanksButton = screen.getByTestId('page-container-footer-cancel');
|
|
fireEvent.click(noThanksButton);
|
|
expect(
|
|
props.setParticipateInMetaMetrics.calledOnceWithExactly(false),
|
|
).toStrictEqual(true);
|
|
});
|
|
});
|