Merge remote-tracking branch 'origin/develop' into fonts-texts-buttons

This commit is contained in:
viktor 2018-07-30 13:07:55 +03:00
commit 5e318673df
5 changed files with 44 additions and 3 deletions

View File

@ -19,3 +19,4 @@ test/integration/bundle.js
test/integration/jquery-3.1.0.min.js
test/integration/helpers.js
test/integration/lib/first-time.js
test/integration/lib/send-new-ui.js

View File

@ -1,5 +1,5 @@
# MetaMask Browser Extension
[![Build Status](https://circleci.com/gh/MetaMask/metamask-extension.svg?style=shield&circle-token=a1ddcf3cd38e29267f254c9c59d556d513e3a1fd)](https://circleci.com/gh/MetaMask/metamask-extension) [![Coverage Status](https://coveralls.io/repos/github/MetaMask/metamask-extension/badge.svg?branch=master)](https://coveralls.io/github/MetaMask/metamask-extension?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/MetaMask/metamask-extension.svg)](https://greenkeeper.io/) [![Stories in Ready](https://badge.waffle.io/MetaMask/metamask-extension.png?label=in%20progress&title=waffle.io)](https://waffle.io/MetaMask/metamask-extension)
[![Build Status](https://circleci.com/gh/poanetwork/metamask-extension.svg?style=shield)](https://circleci.com/gh/poanetwork/metamask-extension) <!--[![Coverage Status](https://coveralls.io/repos/github/poanetwork/metamask-extension/badge.svg?branch=master)](https://coveralls.io/github/poanetwork/metamask-extension?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/poanetwork/metamask-extension.svg)](https://greenkeeper.io/)--> [![Stories in Ready](https://badge.waffle.io/poanetwork/metamask-extension.png?label=in%20progress&title=waffle.io)](https://waffle.io/poanetwork/metamask-extension)
## Support

View File

@ -37,7 +37,7 @@ const {
const STORAGE_KEY = 'metamask-config'
const METAMASK_DEBUG = process.env.METAMASK_DEBUG
log.setDefaultLevel(process.env.METAMASK_DEBUG ? 'debug' : 'warn')
log.setDefaultLevel(METAMASK_DEBUG ? 'debug' : 'warn')
const platform = new ExtensionPlatform()
const notificationManager = new NotificationManager()

View File

@ -331,6 +331,46 @@ describe('Metamask popup page', function () {
})
})
describe('Remove Token', function () {
it('navigates to the remove token screen and goes back', async function () {
// Click to remove first token
const removeTokenButton = await driver.findElement(By.css('#app-content > div > div.app-primary.from-left > div > section > div.full-flex-height > ol > li:nth-child(2) > .fa.fa-trash'))
await removeTokenButton.click()
const removeTokenTitle = await driver.findElement(By.css('#app-content > div > div.app-primary.from-right > div > div.section-title.flex-row.flex-center > h2'))
// Check that the correct page is opened
assert.equal(await removeTokenTitle.getText(), 'REMOVE TOKEN')
// Go back
await driver.findElement(By.css('.fa-arrow-left')).click()
await delay(300)
// Check that the token was not deleted
const tokens = await driver.findElements(By.css('#app-content > div > div.app-primary.from-left > div > section > div.full-flex-height > ol > li'))
assert.equal(tokens.length, 1, 'There should be 1 token')
})
it('navigates to the remove token screen and removes the token', async function () {
// Click to remove first token
const removeTokenButton = await driver.findElement(By.css('#app-content > div > div.app-primary.from-left > div > section > div.full-flex-height > ol > li:nth-child(2) > .fa.fa-trash'))
await removeTokenButton.click()
const removeTokenTitle = await driver.findElement(By.css('#app-content > div > div.app-primary.from-right > div > div.section-title.flex-row.flex-center > h2'))
// Check that the correct page is opened
assert.equal(await removeTokenTitle.getText(), 'REMOVE TOKEN')
// Confirm the removal
const confirmRemoveTokenButton = await driver.findElement(By.css('#app-content > div > div.app-primary.from-right > div > div.flex-column.flex-justify-center.flex-grow.select-none > div > button'))
assert.equal(await confirmRemoveTokenButton.getText(), 'Remove')
await confirmRemoveTokenButton.click()
await delay(300)
// Check that the token was deleted
const tokens = await driver.findElements(By.css('#app-content > div > div.app-primary.from-left > div > section > div.full-flex-height > ol > li'))
assert.equal(tokens.length, 0, 'There should be no tokens')
})
})
describe('Custom Rpc', function () {
it('switches to settings screen', async function () {
await driver.findElement(By.css('.sandwich-expando')).click()

View File

@ -39,7 +39,7 @@ IconFactory.prototype.generateIdenticonSvg = function (address, diameter) {
// creates a new identicon
IconFactory.prototype.generateNewIdenticon = function (address, diameter) {
var numericRepresentation = jsNumberForAddress(address)
var identicon = this.jazzicon(diameter, numericRepresentation)
var identicon = this.jazzicon.generateIdenticon(diameter, numericRepresentation)
return identicon
}