Fix tests. Add className to Identicon ethLogos.

feature/default_network_editable
Alexander Tseung 6 years ago
parent c04d9095dd
commit c18c0e1c30
  1. 2
      test/e2e/beta/from-import-beta-ui.spec.js
  2. 10
      test/e2e/beta/metamask-beta-ui.spec.js
  3. 2
      test/integration/lib/confirm-sig-requests.js
  4. 8
      test/integration/lib/tx-list-items.js
  5. 1
      ui/app/components/identicon.js

@ -317,7 +317,7 @@ describe('Using MetaMask with an existing account', function () {
const transactions = await findElements(driver, By.css('.transaction-list-item')) const transactions = await findElements(driver, By.css('.transaction-list-item'))
assert.equal(transactions.length, 1) assert.equal(transactions.length, 1)
const txValues = await findElements(driver, By.css('.transaction-list-item__amount--secondary')) const txValues = await findElements(driver, By.css('.transaction-list-item__amount--primary'))
assert.equal(txValues.length, 1) assert.equal(txValues.length, 1)
assert.equal(await txValues[0].getText(), '-1 ETH') assert.equal(await txValues[0].getText(), '-1 ETH')
}) })

@ -408,7 +408,7 @@ describe('MetaMask', function () {
assert.equal(transactions.length, 1) assert.equal(transactions.length, 1)
if (process.env.SELENIUM_BROWSER !== 'firefox') { if (process.env.SELENIUM_BROWSER !== 'firefox') {
const txValues = await findElement(driver, By.css('.transaction-list-item__amount--secondary')) const txValues = await findElement(driver, By.css('.transaction-list-item__amount--primary'))
await driver.wait(until.elementTextMatches(txValues, /-1\sETH/), 10000) await driver.wait(until.elementTextMatches(txValues, /-1\sETH/), 10000)
} }
}) })
@ -450,7 +450,7 @@ describe('MetaMask', function () {
const transactions = await findElements(driver, By.css('.transaction-list-item')) const transactions = await findElements(driver, By.css('.transaction-list-item'))
assert.equal(transactions.length, 2) assert.equal(transactions.length, 2)
const txValues = await findElement(driver, By.css('.transaction-list-item__amount--secondary')) const txValues = await findElement(driver, By.css('.transaction-list-item__amount--primary'))
await driver.wait(until.elementTextMatches(txValues, /-3\sETH/), 10000) await driver.wait(until.elementTextMatches(txValues, /-3\sETH/), 10000)
}) })
}) })
@ -528,7 +528,7 @@ describe('MetaMask', function () {
await delay(largeDelayMs) await delay(largeDelayMs)
await findElements(driver, By.css('.transaction-list-item')) await findElements(driver, By.css('.transaction-list-item'))
const [txListValue] = await findElements(driver, By.css('.transaction-list-item__amount--secondary')) const [txListValue] = await findElements(driver, By.css('.transaction-list-item__amount--primary'))
await driver.wait(until.elementTextMatches(txListValue, /-4\sETH/), 10000) await driver.wait(until.elementTextMatches(txListValue, /-4\sETH/), 10000)
await txListValue.click() await txListValue.click()
await delay(regularDelayMs) await delay(regularDelayMs)
@ -562,7 +562,7 @@ describe('MetaMask', function () {
return confirmedTxes.length === 4 return confirmedTxes.length === 4
}, 10000) }, 10000)
const txValues = await findElements(driver, By.css('.transaction-list-item__amount--secondary')) const txValues = await findElements(driver, By.css('.transaction-list-item__amount--primary'))
await driver.wait(until.elementTextMatches(txValues[0], /-4\sETH/), 10000) await driver.wait(until.elementTextMatches(txValues[0], /-4\sETH/), 10000)
// const txAccounts = await findElements(driver, By.css('.tx-list-account')) // const txAccounts = await findElements(driver, By.css('.tx-list-account'))
@ -594,7 +594,7 @@ describe('MetaMask', function () {
return confirmedTxes.length === 5 return confirmedTxes.length === 5
}, 10000) }, 10000)
const txValues = await findElement(driver, By.css('.transaction-list-item__amount--secondary')) const txValues = await findElement(driver, By.css('.transaction-list-item__amount--primary'))
await driver.wait(until.elementTextMatches(txValues, /-0\sETH/), 10000) await driver.wait(until.elementTextMatches(txValues, /-0\sETH/), 10000)
await closeAllWindowHandlesExcept(driver, [extension, dapp]) await closeAllWindowHandlesExcept(driver, [extension, dapp])

@ -19,7 +19,7 @@ async function runConfirmSigRequestsTest (assert, done) {
selectState.val('confirm sig requests') selectState.val('confirm sig requests')
reactTriggerChange(selectState[0]) reactTriggerChange(selectState[0])
const pendingRequestItem = $.find('.transaction-list-item') const pendingRequestItem = $.find('.transaction-list-item .transaction-list-item__grid')
if (pendingRequestItem[0]) { if (pendingRequestItem[0]) {
pendingRequestItem[0].click() pendingRequestItem[0].click()

@ -32,9 +32,11 @@ async function runTxListItemsTest (assert, done) {
const txListItems = await queryAsync($, '.transaction-list-item') const txListItems = await queryAsync($, '.transaction-list-item')
assert.equal(txListItems.length, 8, 'all tx list items are rendered') assert.equal(txListItems.length, 8, 'all tx list items are rendered')
const retryTx = txListItems[1] const retryTxGrid = await findAsync($(txListItems[1]), '.transaction-list-item__grid')
const retryTxLink = await findAsync($(retryTx), '.transaction-list-item__retry') retryTxGrid[0].click()
assert.equal(retryTxLink[0].textContent, 'Taking too long? Increase the gas price on your transaction', 'retryTx has expected link') const retryTxDetails = await findAsync($(txListItems[1]), '.transaction-list-item-details')
const headerButtons = await findAsync($(retryTxDetails[0]), '.transaction-list-item-details__header-button')
assert.equal(headerButtons[0].textContent, 'speed up')
const approvedTx = txListItems[2] const approvedTx = txListItems[2]
const approvedTxRenderedStatus = await findAsync($(approvedTx), '.transaction-list-item__status') const approvedTxRenderedStatus = await findAsync($(approvedTx), '.transaction-list-item__status')

@ -56,6 +56,7 @@ IdenticonComponent.prototype.render = function () {
}) })
} else { } else {
return h('img.balance-icon', { return h('img.balance-icon', {
className,
src: './images/eth_logo.svg', src: './images/eth_logo.svg',
style: { style: {
...style, ...style,

Loading…
Cancel
Save