@@ -701,19 +701,15 @@ describe('Workflow Prompts', () => {
701701 expect ( result . success ) . toBe ( false ) ;
702702 } ) ;
703703
704- it ( 'should coerce non-numeric string for numStages to NaN (fails validation)' , ( ) => {
705- // z.coerce.number() on a non-numeric string produces NaN
704+ it ( 'should reject non-numeric string for numStages (NaN coercion)' , ( ) => {
705+ // z.coerce.number() on a non-numeric string produces NaN, which Zod
706+ // rejects because NaN is not a valid finite number.
706707 const result = workshopCreationWorkflowSchema . safeParse ( {
707708 queryPath : '/q.ql' ,
708709 language : 'java' ,
709710 numStages : 'abc' ,
710711 } ) ;
711- // NaN coercion: z.coerce.number() turns 'abc' into NaN, which is still
712- // type number, so Zod may accept it. Verify the actual behavior:
713- if ( result . success ) {
714- expect ( result . data . numStages ) . toBeNaN ( ) ;
715- }
716- // Either way, the test documents the behavior for slash command edge cases.
712+ expect ( result . success ) . toBe ( false ) ;
717713 } ) ;
718714 } ) ;
719715
@@ -727,7 +723,7 @@ describe('Workflow Prompts', () => {
727723 */
728724 const schemaSpecs : Array < {
729725 name : string ;
730-
726+
731727 schema : any ;
732728 required : string [ ] ;
733729 optional : string [ ] ;
@@ -798,7 +794,7 @@ describe('Workflow Prompts', () => {
798794
799795 it . each ( schemaSpecs ) (
800796 '$name — required fields must cause rejection when omitted individually' ,
801- ( { schema, required, optional } ) => {
797+ ( { schema, required, optional : _optional } ) => {
802798 // Build a fully-valid object first
803799 const validObj : Record < string , string | number > = { } ;
804800 for ( const key of required ) {
@@ -811,7 +807,7 @@ describe('Workflow Prompts', () => {
811807 }
812808 }
813809 // Leave optional keys out — valid object with only required keys
814- void optional ;
810+ void _optional ;
815811
816812 // Verify the base valid object passes
817813 const baseResult = schema . safeParse ( validObj ) ;
@@ -873,7 +869,7 @@ describe('Workflow Prompts', () => {
873869 '%s — every field should have a non-empty description' ,
874870 ( _name , schema ) => {
875871 for ( const [ key , zodType ] of Object . entries ( schema . shape ) ) {
876-
872+
877873 const desc = ( zodType as any ) . description ?? ( zodType as any ) . _def ?. description ;
878874 expect (
879875 desc ,
0 commit comments