2018-04-10 02:01:27 +02:00
|
|
|
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()
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
2018-07-03 00:49:33 +02:00
|
|
|
async function runCurrencyLocalizationTest (assert, done) {
|
2018-04-10 02:01:27 +02:00
|
|
|
console.log('*** start runCurrencyLocalizationTest')
|
|
|
|
const selectState = await queryAsync($, 'select')
|
|
|
|
selectState.val('currency localization')
|
2018-07-11 18:07:26 +02:00
|
|
|
await timeout(1000)
|
2018-04-10 02:01:27 +02:00
|
|
|
reactTriggerChange(selectState[0])
|
|
|
|
await timeout(1000)
|
2018-08-24 04:19:48 +02:00
|
|
|
const txView = await queryAsync($, '.transaction-view')
|
|
|
|
const heroBalance = await findAsync($(txView), '.transaction-view-balance__balance')
|
|
|
|
const fiatAmount = await findAsync($(heroBalance), '.transaction-view-balance__secondary-balance')
|
2018-10-21 13:12:40 +02:00
|
|
|
assert.equal(fiatAmount[0].textContent, '₱102,707.97PHP')
|
2018-04-10 02:01:27 +02:00
|
|
|
}
|