Skip to content

Commit

Permalink
fix: update unittest
Browse files Browse the repository at this point in the history
  • Loading branch information
cafadev committed Dec 18, 2023
1 parent 30d875d commit 911c87a
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { describe, expect, it } from 'vitest'

describe('NormalizeFormFields', () => {
const recordValue = (_: any) => null
const interceptOptions = (options: any[]) => options

it.concurrent('should normalize form fields with default values when no fields are provided', () => {
const command = new NormalizeFormFieldsCommand({})
Expand All @@ -18,11 +19,13 @@ describe('NormalizeFormFields', () => {
type: 'text',
label: 'First Name',
recordValue,
interceptOptions,
},
lastName: {
type: 'text',
label: 'Last Name',
recordValue,
interceptOptions,
},
}

Expand All @@ -36,6 +39,7 @@ describe('NormalizeFormFields', () => {
name: 'firstName',
errors: [],
recordValue,
interceptOptions,
wasFocused: false,
modelValue: null,
ref: null,
Expand All @@ -52,6 +56,7 @@ describe('NormalizeFormFields', () => {
name: 'lastName',
errors: [],
recordValue,
interceptOptions,
wasFocused: false,
ref: null,
modelValue: null,
Expand All @@ -69,6 +74,7 @@ describe('NormalizeFormFields', () => {
label: 'Email',
class: 'custom-class',
recordValue,
interceptOptions,
},
}

Expand All @@ -82,6 +88,7 @@ describe('NormalizeFormFields', () => {
name: 'email',
errors: [],
recordValue,
interceptOptions,
wasFocused: false,
modelValue: null,
ref: null,
Expand All @@ -99,6 +106,7 @@ describe('NormalizeFormFields', () => {
required: true,
minLength: 8,
recordValue,
interceptOptions,
},
}

Expand All @@ -112,6 +120,7 @@ describe('NormalizeFormFields', () => {
name: 'password',
errors: [],
recordValue,
interceptOptions,
wasFocused: false,
modelValue: null,
ref: null,
Expand Down

0 comments on commit 911c87a

Please sign in to comment.