diff options
| author | Jakub Mandula <[email protected]> | 2017-02-26 13:51:40 +0000 |
|---|---|---|
| committer | Jakub Mandula <[email protected]> | 2017-02-26 13:51:40 +0000 |
| commit | 232a2a58d70935c57d311b5ba237347f703c2131 (patch) | |
| tree | 69f695e62e17386988c47f8522bf5e14db193839 /test/commerce.unit.js | |
| parent | d6c20353360ef1eefb56128eeb50ece4f5845372 (diff) | |
| parent | f379057be0112d6732b056d93d1380be18e1087a (diff) | |
| download | faker-232a2a58d70935c57d311b5ba237347f703c2131.tar.xz faker-232a2a58d70935c57d311b5ba237347f703c2131.zip | |
Merge branch 'Mark/origin' into creditCard
Diffstat (limited to 'test/commerce.unit.js')
| -rw-r--r-- | test/commerce.unit.js | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/test/commerce.unit.js b/test/commerce.unit.js index 06445e34..1b5c5bdd 100644 --- a/test/commerce.unit.js +++ b/test/commerce.unit.js @@ -72,7 +72,7 @@ describe("commerce.js", function() { }); }); - describe("price(min, max, dec, symbol", function() { + describe("price(min, max, dec, symbol)", function() { it("should use the default amounts when not passing arguments", function() { var price = faker.commerce.price(); @@ -110,6 +110,23 @@ describe("commerce.js", function() { assert.ok(amount); assert.equal((amount == 0.00), true, "the amount should equal 0"); }); + + it("it should handle argument dec", function () { + + var price = faker.commerce.price(100, 100, 1); + + assert.ok(price); + assert.strictEqual(price , '100.0', "the price should be equal 100.0"); + }); + + it("it should handle argument dec = 0", function () { + + var price = faker.commerce.price(100, 100, 0); + + assert.ok(price); + assert.strictEqual(price , '100', "the price should be equal 100"); + }); + }); });
\ No newline at end of file |
