Skip to content

Commit

Permalink
💚 test(ci): fix failed
Browse files Browse the repository at this point in the history
  • Loading branch information
kazupon committed Sep 25, 2018
1 parent db8ff07 commit 40bcdef
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
8 changes: 4 additions & 4 deletions test/unit/basic.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -695,8 +695,8 @@ describe('basic', () => {
})

it('should respect other number options', () => {
const options = { style: 'currency', currency: 'EUR', currencyDisplay: 'code' }
assert.equal(i18n.n(money, options), 'EUR10,100.00')
const options = { style: 'currency', currency: 'EUR', currencyDisplay: 'symbol' }
assert.equal(i18n.n(money, options), '€10,100.00')
})
})

Expand All @@ -706,8 +706,8 @@ describe('basic', () => {
})

it('should respect other number options', () => {
const options = { key: 'currency', currency: 'EUR', currencyDisplay: 'code' }
assert.equal(i18n.n(money, options), 'EUR10,100.00')
const options = { key: 'currency', currency: 'EUR', currencyDisplay: 'symbol' }
assert.equal(i18n.n(money, options), '€10,100.00')
})
})
})
Expand Down
14 changes: 13 additions & 1 deletion test/unit/number.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
import numberFormats from './fixture/number'

function convertToCharCodes (str) {
const codes = []
for (let i = 0; i < str.length; i++) {
codes.push(str.charCodeAt(i))
}
return codes
}

const desc = VueI18n.availabilities.numberFormat ? describe : describe.skip
desc('number format', () => {
describe('numberFormats', () => {
Expand Down Expand Up @@ -44,7 +52,11 @@ desc('number format', () => {
i18n.locale = 'zh-CN'
}).then(() => {
// NOTE: avoid webkit (safari/phantomjs) & Intl polyfill wired localization...
isChrome && assert.equal(text.textContent, '101.00人民币')
if (isChrome) {
const actual = [49, 48, 49, 46, 48, 48, 160, 20154, 27665, 24065] // 101.00&nbsp;人民币
const target = convertToCharCodes(text.textContent)
assert.deepEqual(target, actual)
}
}).then(done)
})
})
Expand Down

0 comments on commit 40bcdef

Please sign in to comment.