diff options
author | Dan <danjm.com@gmail.com> | 2018-04-19 02:45:48 +0800 |
---|---|---|
committer | Dan <danjm.com@gmail.com> | 2018-04-19 02:45:48 +0800 |
commit | 649d2f8b229a6a749c0129dd5ef6dcf5b870e6c9 (patch) | |
tree | bc1e935331aa3678d18c2ffbcc04e791a711c0aa /test/integration | |
parent | e80bd230b9bb6ac9ff05d7095f74dd2fd7ebb3af (diff) | |
parent | 7e21fc2aa780ccb4ffb2f642156385db22c47a52 (diff) | |
download | tangerine-wallet-browser-649d2f8b229a6a749c0129dd5ef6dcf5b870e6c9.tar.gz tangerine-wallet-browser-649d2f8b229a6a749c0129dd5ef6dcf5b870e6c9.tar.zst tangerine-wallet-browser-649d2f8b229a6a749c0129dd5ef6dcf5b870e6c9.zip |
Merge branch 'master' into dm-docs-1
Diffstat (limited to 'test/integration')
-rw-r--r-- | test/integration/lib/currency-localization.js | 28 | ||||
-rw-r--r-- | test/integration/lib/send-new-ui.js | 8 |
2 files changed, 32 insertions, 4 deletions
diff --git a/test/integration/lib/currency-localization.js b/test/integration/lib/currency-localization.js new file mode 100644 index 000000000..7705c9720 --- /dev/null +++ b/test/integration/lib/currency-localization.js @@ -0,0 +1,28 @@ +const reactTriggerChange = require('../../lib/react-trigger-change') +const { + timeout, + queryAsync, + findAsync, +} = require('../../lib/util') + +QUnit.module('currency localization') + +QUnit.test('renders localized currency', (assert) => { + const done = assert.async() + runCurrencyLocalizationTest(assert).then(done).catch((err) => { + assert.notOk(err, `Error was thrown: ${err.stack}`) + done() + }) +}) + +async function runCurrencyLocalizationTest(assert, done) { + console.log('*** start runCurrencyLocalizationTest') + const selectState = await queryAsync($, 'select') + selectState.val('currency localization') + reactTriggerChange(selectState[0]) + await timeout(1000) + const txView = await queryAsync($, '.tx-view') + const heroBalance = await findAsync($(txView), '.hero-balance') + const fiatAmount = await findAsync($(heroBalance), '.fiat-amount') + assert.equal(fiatAmount[0].textContent, '₱102,707.97') +} diff --git a/test/integration/lib/send-new-ui.js b/test/integration/lib/send-new-ui.js index 4731117d7..09a074750 100644 --- a/test/integration/lib/send-new-ui.js +++ b/test/integration/lib/send-new-ui.js @@ -91,7 +91,7 @@ async function runSendFlowTest(assert, done) { ) assert.equal( sendGasField.find('.currency-display__converted-value')[0].textContent, - '0.24 USD', + '$0.24 USD', 'send gas field should show estimated gas total converted to USD' ) @@ -118,7 +118,7 @@ async function runSendFlowTest(assert, done) { ) assert.equal( (await findAsync(sendGasField, '.currency-display__converted-value'))[0].textContent, - '3.60 USD', + '$3.60 USD', 'send gas field should show customized gas total converted to USD' ) @@ -138,9 +138,9 @@ async function runSendFlowTest(assert, done) { const confirmScreenRows = await queryAsync($, '.confirm-screen-rows') const confirmScreenGas = confirmScreenRows.find('.currency-display__converted-value')[0] - assert.equal(confirmScreenGas.textContent, '3.60 USD', 'confirm screen should show correct gas') + assert.equal(confirmScreenGas.textContent, '$3.60 USD', 'confirm screen should show correct gas') const confirmScreenTotal = confirmScreenRows.find('.confirm-screen-row-info')[2] - assert.equal(confirmScreenTotal.textContent, '2405.36 USD', 'confirm screen should show correct total') + assert.equal(confirmScreenTotal.textContent, '$2,405.36 USD', 'confirm screen should show correct total') const confirmScreenBackButton = await queryAsync($, '.page-container__back-button') confirmScreenBackButton[0].click() |