Skip to content

Commit 13c42e7

Browse files
committed
test: fix failing tests
1 parent c136782 commit 13c42e7

File tree

1 file changed

+31
-23
lines changed

1 file changed

+31
-23
lines changed

test/bindings/vinejs.spec.ts

+31-23
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,11 @@ test.group('VineJS | unique', (group) => {
107107
} catch (error) {
108108
if (dialectPerformsCaseSensitiveSearch) {
109109
assert.deepEqual(error.messages, [
110+
{
111+
field: 'username',
112+
message: 'The username has already been taken',
113+
rule: 'database.unique',
114+
},
110115
{
111116
field: 'email',
112117
message: 'The email has already been taken',
@@ -337,29 +342,32 @@ test.group('VineJS | exists', (group) => {
337342
})
338343
)
339344

340-
try {
341-
await validator.validate({
342-
/**
343-
* Username validation will fail because of case
344-
* mismatch
345-
*/
346-
username: 'foo',
347-
/**
348-
* Email validation will pass regardless of the
349-
* case mismatch
350-
*/
351-
352-
})
353-
} catch (error) {
354-
if (dialectPerformsCaseSensitiveSearch) {
355-
assert.deepEqual(error.messages, [
356-
{
357-
field: 'email',
358-
message: 'The email has already been taken',
359-
rule: 'database.unique',
360-
},
361-
])
362-
} else {
345+
if (dialectPerformsCaseSensitiveSearch) {
346+
assert.deepEqual(
347+
await validator.validate({
348+
username: 'foo',
349+
350+
}),
351+
{
352+
username: 'foo',
353+
354+
}
355+
)
356+
} else {
357+
try {
358+
await validator.validate({
359+
/**
360+
* Username validation will fail because of case
361+
* mismatch
362+
*/
363+
username: 'foo',
364+
/**
365+
* Email validation will pass regardless of the
366+
* case mismatch
367+
*/
368+
369+
})
370+
} catch (error) {
363371
assert.deepEqual(error.messages, [
364372
{
365373
field: 'username',

0 commit comments

Comments
 (0)