Skip to content

Commit 8c2207f

Browse files
committed
Updated percent filter test
1 parent 2b4fcdb commit 8c2207f

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

test/filters.spec.js

+8-2
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,12 @@ describe('Filters', function () {
277277
expect(filter(0.974878234, 3)).toBe('97.488%')
278278
expect(filter(0.0003, 1)).toBe('0.0%')
279279

280+
// different multiplier
281+
expect(filter(0.1, 0, 150)).toBe('15%')
282+
expect(filter(0.2, 1, 150)).toBe('30.0%')
283+
expect(filter(1.2, 0, 300)).toBe('360%')
284+
expect(filter(0.974878234, 3, 150)).toBe('146.232%')
285+
280286
// edge cases
281287
expect(filter(undefined)).toBe('0%')
282288
expect(filter(null)).toBe('0%')
@@ -285,10 +291,10 @@ describe('Filters', function () {
285291

286292
it('percent with global options', function () {
287293
var filter = otherFilters.percent.bind({
288-
percent: { decimalDigits: 1 },
294+
percent: { decimalDigits: 1, multiplier: 150 },
289295
})
290296

291-
expect(filter(100)).toBe('10000.0%')
297+
expect(filter(100)).toBe('15000.0%')
292298
})
293299

294300
it('limitByArray', function () {

0 commit comments

Comments
 (0)