1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 01:39:44 +01:00

Fix integration tests

This commit is contained in:
Alexander Tseung 2019-01-14 17:37:42 -08:00 committed by Whymarrh Whitby
parent 941a9a0fd9
commit 7d18a47c22
2 changed files with 756 additions and 20 deletions

File diff suppressed because one or more lines are too long

View File

@ -16,7 +16,7 @@ QUnit.test('renders list items successfully', (assert) => {
global.ethQuery = global.ethQuery || {}
global.ethQuery.getTransactionCount = (_, cb) => {
cb(null, '0x3')
cb(null, '0x4')
}
async function runTxListItemsTest (assert, done) {
@ -30,25 +30,21 @@ async function runTxListItemsTest (assert, done) {
metamaskLogo[0].click()
const txListItems = await queryAsync($, '.transaction-list-item')
assert.equal(txListItems.length, 7, 'all tx list items are rendered')
assert.equal(txListItems.length, 6, 'all tx list items are rendered')
const approvedTx = txListItems[0]
const approvedTxRenderedStatus = await findAsync($(approvedTx), '.transaction-list-item__status')
assert.equal(approvedTxRenderedStatus[0].textContent, 'pending', 'approvedTx has correct label')
const unapprovedMsg = txListItems[1]
const unapprovedMsg = txListItems[0]
const unapprovedMsgDescription = await findAsync($(unapprovedMsg), '.transaction-list-item__action')
assert.equal(unapprovedMsgDescription[0].textContent, 'Signature Request', 'unapprovedMsg has correct description')
const approvedTx = txListItems[2]
const approvedTxRenderedStatus = await findAsync($(approvedTx), '.transaction-list-item__status')
assert.equal(approvedTxRenderedStatus[0].textContent, 'pending', 'approvedTx has correct label')
const shapeShiftTx = txListItems[4]
const shapeShiftTxStatus = await findAsync($(shapeShiftTx), '.flex-column div:eq(1)')
assert.equal(shapeShiftTxStatus[0].textContent, 'No deposits received', 'shapeShiftTx has correct status')
const rejectedTx = txListItems[5]
const rejectedTxRenderedStatus = await findAsync($(rejectedTx), '.transaction-list-item__status')
assert.equal(rejectedTxRenderedStatus[0].textContent, 'Rejected', 'rejectedTx has correct label')
const confirmedTokenTx = txListItems[6]
const confirmedTokenTx = txListItems[5]
const confirmedTokenTxAddress = await findAsync($(confirmedTokenTx), '.transaction-list-item__status')
assert.equal(confirmedTokenTxAddress[0].textContent, 'Confirmed', 'confirmedTokenTx has correct address')
}