mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-24 02:58:09 +01:00
4f3fc95d50
* Use @metamask/eslint-config@1.1.0 * Use eslint-plugin-mocha@6.2.2 * Mark root ESLint config as root * Update Mocha ESLint rules with shared ESLint config
30 lines
949 B
JavaScript
30 lines
949 B
JavaScript
import React from 'react'
|
|
import assert from 'assert'
|
|
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()
|
|
})
|
|
})
|