diff options
author | Whymarrh Whitby <whymarrh.whitby@gmail.com> | 2018-06-21 03:04:44 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-21 03:04:44 +0800 |
commit | 41a48195ad76c268cfadc637a451ebe0281f058f (patch) | |
tree | 7de308df3c71d68eb500b5693e43555b79119eb4 /test | |
parent | 40fad619088bd955d5505cc839a7521ac43235f9 (diff) | |
parent | 1509a4393a241eb18be6702a913f2041818b2972 (diff) | |
download | tangerine-wallet-browser-41a48195ad76c268cfadc637a451ebe0281f058f.tar.gz tangerine-wallet-browser-41a48195ad76c268cfadc637a451ebe0281f058f.tar.zst tangerine-wallet-browser-41a48195ad76c268cfadc637a451ebe0281f058f.zip |
Merge pull request #4575 from whymarrh/token-amount-overflow
Handle token amount overflows
Diffstat (limited to 'test')
-rw-r--r-- | test/e2e/beta/from-import-beta-ui.spec.js | 7 | ||||
-rw-r--r-- | test/e2e/beta/metamask-beta-ui.spec.js | 8 |
2 files changed, 8 insertions, 7 deletions
diff --git a/test/e2e/beta/from-import-beta-ui.spec.js b/test/e2e/beta/from-import-beta-ui.spec.js index 823c72a3a..8af654319 100644 --- a/test/e2e/beta/from-import-beta-ui.spec.js +++ b/test/e2e/beta/from-import-beta-ui.spec.js @@ -348,8 +348,9 @@ describe('Using MetaMask with an existing account', function () { it('renders the balance for the new token', async () => { const balance = await findElement(driver, By.css('.tx-view .balance-display .token-amount')) + await driver.wait(until.elementTextMatches(balance, /^0\s*BAT\s*$/), 10000) const tokenAmount = await balance.getText() - assert.equal(tokenAmount, '0BAT') + assert.ok(/^0\s*BAT\s*$/.test(tokenAmount)) await delay(regularDelayMs) }) }) @@ -421,9 +422,9 @@ describe('Using MetaMask with an existing account', function () { it('renders the balance for the new token', async () => { const balance = await findElement(driver, By.css('.tx-view .balance-display .token-amount')) - await driver.wait(until.elementTextIs(balance, '100TST')) + await driver.wait(until.elementTextMatches(balance, /^100\s*TST\s*$/), 10000) const tokenAmount = await balance.getText() - assert.equal(tokenAmount, '100TST') + assert.ok(/^100\s*TST\s*$/.test(tokenAmount)) await delay(regularDelayMs) }) }) diff --git a/test/e2e/beta/metamask-beta-ui.spec.js b/test/e2e/beta/metamask-beta-ui.spec.js index d911b91ed..71329bff7 100644 --- a/test/e2e/beta/metamask-beta-ui.spec.js +++ b/test/e2e/beta/metamask-beta-ui.spec.js @@ -430,9 +430,9 @@ describe('MetaMask', function () { it('renders the balance for the chosen token', async () => { const balance = await findElement(driver, By.css('.tx-view .balance-display .token-amount')) - await driver.wait(until.elementTextIs(balance, '0BAT')) + await driver.wait(until.elementTextMatches(balance, /^0\s*BAT\s*$/), 10000) const tokenAmount = await balance.getText() - assert.equal(tokenAmount, '0BAT') + assert.ok(/^0\s*BAT\s*$/.test(tokenAmount)) await delay(regularDelayMs) }) }) @@ -504,9 +504,9 @@ describe('MetaMask', function () { it('renders the balance for the new token', async () => { const balance = await findElement(driver, By.css('.tx-view .balance-display .token-amount')) - await driver.wait(until.elementTextIs(balance, '100TST')) + await driver.wait(until.elementTextMatches(balance, /^100\s*TST\s*$/)) const tokenAmount = await balance.getText() - assert.equal(tokenAmount, '100TST') + assert.ok(/^100\s*TST\s*$/.test(tokenAmount)) await delay(regularDelayMs) }) }) |