1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-24 12:23:39 +02:00
metamask-extension/ui/app/pages/first-time-flow/metametrics-opt-in/tests/metametrics-opt-in.test.js
Whymarrh Whitby c1e3c229bc
Fix import/order issues (#9239)
See [`import/order`](https://eslint.org/docs/rules/import/order) for more information.

This change enables `import/order` and fixes the issues raised by the rule.
2020-08-18 16:48:25 -02:30

30 lines
950 B
JavaScript

import assert from 'assert'
import React from 'react'
import sinon from 'sinon'
import configureMockStore from 'redux-mock-store'
import { mountWithRouter } from '../../../../../../test/lib/render-helpers'
import MetaMetricsOptIn from '../index'
describe('MetaMetricsOptIn', function () {
it('opt out of MetaMetrics', function () {
const props = {
history: {
push: sinon.spy(),
},
setParticipateInMetaMetrics: sinon.stub().resolves(),
participateInMetaMetrics: false,
}
const store = configureMockStore()({
metamask: {},
})
const wrapper = mountWithRouter(
<MetaMetricsOptIn.WrappedComponent {...props} />, store,
)
const noThanksButton = wrapper.find('.btn-default.page-container__footer-button')
noThanksButton.simulate('click')
assert.ok(props.setParticipateInMetaMetrics.calledOnceWithExactly(false))
props.setParticipateInMetaMetrics.resetHistory()
})
})