1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 18:00:18 +01:00

Add messages for MetaMetrics opt-in (#9283)

* Add messages for MetaMetrics opt-in
This commit is contained in:
Erik Marks 2020-08-20 17:13:14 -07:00 committed by GitHub
parent f656d3236e
commit e08a55c8bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 14 additions and 8 deletions

View File

@ -3,6 +3,9 @@
"message": "I have read and agree to the $1",
"description": "$1 is the `terms` message"
},
"affirmAgree": {
"message": "I Agree"
},
"eth_accounts": {
"message": "View the addresses of your permitted accounts (required)",
"description": "The description for the `eth_accounts` permission"

View File

@ -58,7 +58,7 @@ describe('MetaMask', function () {
await driver.delay(largeDelayMs)
})
it('clicks the "I agree" option on the metametrics opt-in screen', async function () {
it('clicks the "I Agree" option on the metametrics opt-in screen', async function () {
await driver.clickElement(By.css('.btn-primary'))
await driver.delay(largeDelayMs)
})

View File

@ -11,10 +11,11 @@ export default class MetaMetricsOptInModal extends Component {
static contextTypes = {
metricsEvent: PropTypes.func,
t: PropTypes.func,
}
render () {
const { metricsEvent } = this.context
const { metricsEvent, t } = this.context
const { setParticipateInMetaMetrics, hideModal } = this.props
return (
@ -103,7 +104,7 @@ export default class MetaMetricsOptInModal extends Component {
hideModal()
})
}}
cancelText="No Thanks"
cancelText={t('noThanks')}
hideCancel={false}
onSubmit={() => {
setParticipateInMetaMetrics(true)
@ -119,7 +120,7 @@ export default class MetaMetricsOptInModal extends Component {
hideModal()
})
}}
submitText="I agree"
submitText={t('affirmAgree')}
submitButtonType="confirm"
disabled={false}
/>

View File

@ -3,6 +3,7 @@ import React from 'react'
import sinon from 'sinon'
import { mount } from 'enzyme'
import MetaMetricsOptIn from '..'
import messages from '../../../../../../../app/_locales/en/messages.json'
describe('MetaMetrics Opt In', function () {
let wrapper
@ -18,6 +19,7 @@ describe('MetaMetrics Opt In', function () {
<MetaMetricsOptIn.WrappedComponent {...props} />, {
context: {
metricsEvent: () => undefined,
t: (key) => messages[key].message,
},
},
)
@ -41,8 +43,8 @@ describe('MetaMetrics Opt In', function () {
})
it('passes true to setParticipateInMetaMetrics and hides modal', function (done) {
const iAgree = wrapper.find('.btn-primary.page-container__footer-button')
iAgree.simulate('click')
const affirmAgree = wrapper.find('.btn-primary.page-container__footer-button')
affirmAgree.simulate('click')
setImmediate(() => {
assert(props.setParticipateInMetaMetrics.calledOnce)

View File

@ -105,7 +105,7 @@ export default class MetaMetricsOptIn extends Component {
})
})
}}
cancelText="No Thanks"
cancelText={t('noThanks')}
hideCancel={false}
onSubmit={() => {
setParticipateInMetaMetrics(true)
@ -138,7 +138,7 @@ export default class MetaMetricsOptIn extends Component {
})
})
}}
submitText="I agree"
submitText={t('affirmAgree')}
submitButtonType="primary"
disabled={false}
/>