Skip to content

Commit

Permalink
cover validators.required method
Browse files Browse the repository at this point in the history
  • Loading branch information
icebob committed Jul 7, 2016
1 parent 3fede6d commit df2516c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/unit/specs/utils/validators.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,18 @@ function check(validator, value, field, errorCount) {

describe("Validators", () => {

describe("test Validators.required", () => {

it("should NOT give error if value is null, but field is NOT required", () => {
check(v.required, null, { required: false }, 0);
});

it("should give error if value is null, but field is required", () => {
check(v.required, null, { required: true }, 1);
});

});

describe("test Validators.number", () => {

let field = {
Expand Down

0 comments on commit df2516c

Please sign in to comment.