-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into greenkeeper-eslint-3.5.0
- Loading branch information
Showing
3 changed files
with
2 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,7 @@ | ||
import test from 'ava'; | ||
import validation from '../lib/validation'; | ||
|
||
const input = { | ||
target: { | ||
name: 'month', | ||
value: 'foo bar baz', | ||
}, | ||
all: { | ||
month: 'foo bar baz', | ||
}, | ||
}; | ||
|
||
const settings = { | ||
target: { | ||
empty: false, | ||
}, | ||
all: { | ||
month: { | ||
empty: false, | ||
}, | ||
}, | ||
}; | ||
|
||
|
||
// Valid input | ||
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), 'month cannot be left blank!', 'Return string if not valid'); | ||
t.true(validation(), 'Empty input returns true'); | ||
}); |