Skip to content

Commit

Permalink
Merge 55c4de1 into 623c03b
Browse files Browse the repository at this point in the history
  • Loading branch information
rachelnicole committed Jul 12, 2016
2 parents 623c03b + 55c4de1 commit 9a91308
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
7 changes: 2 additions & 5 deletions lib/validation.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@
* @module checkboxValidation
*/

module.exports = function checkboxValidation(input, settings) {
if (input.target.value === '' && !settings.target.empty) {
return `${input.target.name} cannot be left blank!`;
}

// testing
module.exports = function checkboxValidation() {
return true;
};
8 changes: 0 additions & 8 deletions tests/validation.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,3 @@ const settings = {
test('valid input', t => {
t.true(validation(input, settings), 'Valid input returns true');
});

// Invalid input
test('validate correct input', t => {
const ip = input;
ip.target.value = '';

t.is(validation(ip, settings), 'checkbox cannot be left blank!', 'Return string if not valid');
});

0 comments on commit 9a91308

Please sign in to comment.