File tree Expand file tree Collapse file tree 2 files changed +0
-41
lines changed
Expand file tree Collapse file tree 2 files changed +0
-41
lines changed Original file line number Diff line number Diff line change @@ -64,14 +64,6 @@ const formCreationStrategies = [
6464 return { form : { ...form , message : '' } } ;
6565 } ,
6666 } ,
67- {
68- name : 'Use zod adapter explicitly' ,
69- async run ( ) {
70- const zodAdapter = zod ( authSchema ) ;
71- const form = await superValidate ( null , zodAdapter ) ;
72- return { form : { ...form , message : '' } } ;
73- } ,
74- } ,
7567 {
7668 name : 'Create form by manually defining structure' ,
7769 async run ( ) {
@@ -128,14 +120,6 @@ const formValidationStrategies = [
128120 return { form : { ...form , message : '' } } ;
129121 } ,
130122 } ,
131- {
132- name : 'Use zod adapter explicitly with request' ,
133- async run ( request : Request ) {
134- const zodAdapter = zod ( authSchema ) ;
135- const form = await superValidate ( request , zodAdapter ) ;
136- return { form : { ...form , message : '' } } ;
137- } ,
138- } ,
139123 {
140124 name : 'Create fallback form manually' ,
141125 async run ( _request : Request ) {
Original file line number Diff line number Diff line change @@ -67,31 +67,6 @@ describe('createAuthFormWithFallback', () => {
6767 } ) ;
6868 } ) ;
6969
70- test ( 'expect to fallback to explicit zod adapter when basic strategy fails' , async ( ) => {
71- const mockForm = {
72- id : 'test-form-id' ,
73- valid : true ,
74- posted : false ,
75- data : { username : '' , password : '' } ,
76- errors : { } ,
77- constraints : { } ,
78- shape : { } ,
79- } ;
80-
81- vi . mocked ( superValidate )
82- . mockRejectedValueOnce ( new Error ( 'Failed to create with basic strategy' ) )
83- . mockResolvedValueOnce ( mockForm ) ;
84- vi . mocked ( zod ) . mockReturnValue ( { } as any ) ;
85-
86- const result = await createAuthFormWithFallback ( ) ;
87-
88- expect ( result . form ) . toMatchObject ( {
89- valid : true ,
90- data : { username : '' , password : '' } ,
91- message : '' ,
92- } ) ;
93- } ) ;
94-
9570 test ( 'expect to use manual form creation when all superValidate attempts fail' , async ( ) => {
9671 vi . mocked ( superValidate )
9772 . mockRejectedValueOnce ( new Error ( 'Failed to create strategy using SuperValidate' ) )
You can’t perform that action at this time.
0 commit comments