mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
client: reorganize filters and add tests
This commit is contained in:
8
test/client/unit/specs/filters/floor.spec.js
Normal file
8
test/client/unit/specs/filters/floor.spec.js
Normal file
@@ -0,0 +1,8 @@
|
||||
import floorFilter from 'client/filters/floor';
|
||||
|
||||
describe('floor filter', () => {
|
||||
it('can floor a decimal number', () => {
|
||||
expect(floorFilter(4.567)).to.equal(4.56);
|
||||
expect(floorFilter(4.562)).to.equal(4.56);
|
||||
});
|
||||
});
|
||||
8
test/client/unit/specs/filters/round.spec.js
Normal file
8
test/client/unit/specs/filters/round.spec.js
Normal file
@@ -0,0 +1,8 @@
|
||||
import roundFilter from 'client/filters/round';
|
||||
|
||||
describe('round filter', () => {
|
||||
it('can round a decimal number', () => {
|
||||
expect(roundFilter(4.567)).to.equal(4.57);
|
||||
expect(roundFilter(4.562)).to.equal(4.56);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user