Skip to content

Commit

Permalink
😒 🔥 remove old validation
Browse files Browse the repository at this point in the history
  • Loading branch information
scottnath committed Sep 12, 2016
1 parent 1aea474 commit c8b74a9
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 16 deletions.
3 changes: 0 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ module.exports = {
label: 'date',
placeholder: 'date',
type: 'date',
settings: {
empty: true,
},
},
},
html: '<label for="{{date.id}}">{{date.label}}</label><input type="{{date.type}}" id="{{date.id}}" name="{{date.name}}" value="{{date.value}}" placeholder="{{date.placeholder}}" />',
Expand Down
6 changes: 1 addition & 5 deletions lib/validation.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@
* @module dateValidation
*/

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

module.exports = function dateValidation() {
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), 'date cannot be left blank!', 'Return string if not valid');
});

0 comments on commit c8b74a9

Please sign in to comment.