-
-
Notifications
You must be signed in to change notification settings - Fork 197
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c136782
commit 13c42e7
Showing
1 changed file
with
31 additions
and
23 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -107,6 +107,11 @@ test.group('VineJS | unique', (group) => { | |
} catch (error) { | ||
if (dialectPerformsCaseSensitiveSearch) { | ||
assert.deepEqual(error.messages, [ | ||
{ | ||
field: 'username', | ||
message: 'The username has already been taken', | ||
rule: 'database.unique', | ||
}, | ||
{ | ||
field: 'email', | ||
message: 'The email has already been taken', | ||
|
@@ -337,29 +342,32 @@ test.group('VineJS | exists', (group) => { | |
}) | ||
) | ||
|
||
try { | ||
await validator.validate({ | ||
/** | ||
* Username validation will fail because of case | ||
* mismatch | ||
*/ | ||
username: 'foo', | ||
/** | ||
* Email validation will pass regardless of the | ||
* case mismatch | ||
*/ | ||
email: '[email protected]', | ||
}) | ||
} catch (error) { | ||
if (dialectPerformsCaseSensitiveSearch) { | ||
assert.deepEqual(error.messages, [ | ||
{ | ||
field: 'email', | ||
message: 'The email has already been taken', | ||
rule: 'database.unique', | ||
}, | ||
]) | ||
} else { | ||
if (dialectPerformsCaseSensitiveSearch) { | ||
assert.deepEqual( | ||
await validator.validate({ | ||
username: 'foo', | ||
email: '[email protected]', | ||
}), | ||
{ | ||
username: 'foo', | ||
email: '[email protected]', | ||
} | ||
) | ||
} else { | ||
try { | ||
await validator.validate({ | ||
/** | ||
* Username validation will fail because of case | ||
* mismatch | ||
*/ | ||
username: 'foo', | ||
/** | ||
* Email validation will pass regardless of the | ||
* case mismatch | ||
*/ | ||
email: '[email protected]', | ||
}) | ||
} catch (error) { | ||
assert.deepEqual(error.messages, [ | ||
{ | ||
field: 'username', | ||
|