aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorWhymarrh Whitby <whymarrh.whitby@gmail.com>2018-06-21 02:17:11 +0800
committerWhymarrh Whitby <whymarrh.whitby@gmail.com>2018-06-21 02:45:22 +0800
commit1509a4393a241eb18be6702a913f2041818b2972 (patch)
tree7de308df3c71d68eb500b5693e43555b79119eb4 /test
parent4cd4d99e70902fe14c3c91938df8f1557f2524e8 (diff)
downloadtangerine-wallet-browser-1509a4393a241eb18be6702a913f2041818b2972.tar
tangerine-wallet-browser-1509a4393a241eb18be6702a913f2041818b2972.tar.gz
tangerine-wallet-browser-1509a4393a241eb18be6702a913f2041818b2972.tar.bz2
tangerine-wallet-browser-1509a4393a241eb18be6702a913f2041818b2972.tar.lz
tangerine-wallet-browser-1509a4393a241eb18be6702a913f2041818b2972.tar.xz
tangerine-wallet-browser-1509a4393a241eb18be6702a913f2041818b2972.tar.zst
tangerine-wallet-browser-1509a4393a241eb18be6702a913f2041818b2972.zip
Accept whitespace when matching token balances in e2e tests
Diffstat (limited to 'test')
-rw-r--r--test/e2e/beta/from-import-beta-ui.spec.js7
-rw-r--r--test/e2e/beta/metamask-beta-ui.spec.js8
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 bc8fd2919..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'), 10000)
+ 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)
})
})