Merge branch 'develop' of github.com:MetaMask/metamask-extension into trezor-v5

feature/default_network_editable
brunobar79 6 years ago
commit 18f39ef69e
  1. 5
      app/scripts/contentscript.js
  2. 35
      ui/app/components/transaction-status/tests/transaction-status.component.test.js
  3. 1
      ui/app/components/transaction-status/transaction-status.component.js

@ -302,6 +302,11 @@ function getSiteName (window) {
return siteName.content
}
const metaTitle = document.querySelector('head > meta[name="title"]')
if (metaTitle) {
return metaTitle.content
}
return document.title
}

@ -0,0 +1,35 @@
import React from 'react'
import assert from 'assert'
import { mount } from 'enzyme'
import TransactionStatus from '../transaction-status.component'
import Tooltip from '../../tooltip-v2'
describe('TransactionStatus Component', () => {
it('should render APPROVED properly', () => {
const wrapper = mount(
<TransactionStatus
statusKey="approved"
title="test-title"
/>,
{ context: { t: str => str.toUpperCase() } }
)
assert.ok(wrapper)
const tooltipProps = wrapper.find(Tooltip).props()
assert.equal(tooltipProps.children, 'APPROVED')
assert.equal(tooltipProps.title, 'test-title')
})
it('should render SUBMITTED properly', () => {
const wrapper = mount(
<TransactionStatus
statusKey="submitted"
/>,
{ context: { t: str => str.toUpperCase() } }
)
assert.ok(wrapper)
const tooltipProps = wrapper.find(Tooltip).props()
assert.equal(tooltipProps.children, 'PENDING')
})
})

@ -25,7 +25,6 @@ const statusToClassNameHash = {
}
const statusToTextHash = {
[APPROVED_STATUS]: 'pending',
[SUBMITTED_STATUS]: 'pending',
}

Loading…
Cancel
Save