@@ -284,6 +284,12 @@ describe('buildPropValue', () => {
284284 assert . deepEqual ( buildPropValue ( 'number' , '3.14' ) , { number : 3.14 } ) ;
285285 } ) ;
286286
287+ it ( 'rejects invalid number property' , ( ) => {
288+ assert . deepEqual ( buildPropValue ( 'number' , 'abc' ) , {
289+ error : 'Invalid number value: "abc"' ,
290+ } ) ;
291+ } ) ;
292+
287293 it ( 'builds select property' , ( ) => {
288294 assert . deepEqual ( buildPropValue ( 'select' , 'Option A' ) , {
289295 select : { name : 'Option A' } ,
@@ -308,6 +314,18 @@ describe('buildPropValue', () => {
308314 } ) ;
309315 } ) ;
310316
317+ it ( 'builds date property with full ISO date-time' , ( ) => {
318+ assert . deepEqual ( buildPropValue ( 'date' , '2024-01-15T10:30:00Z' ) , {
319+ date : { start : '2024-01-15T10:30:00Z' } ,
320+ } ) ;
321+ } ) ;
322+
323+ it ( 'rejects invalid date property' , ( ) => {
324+ assert . deepEqual ( buildPropValue ( 'date' , '2024-13-01' ) , {
325+ error : 'Invalid date value: "2024-13-01" (expected YYYY-MM-DD or full ISO 8601)' ,
326+ } ) ;
327+ } ) ;
328+
311329 it ( 'builds checkbox property — true values' , ( ) => {
312330 assert . deepEqual ( buildPropValue ( 'checkbox' , 'true' ) , { checkbox : true } ) ;
313331 assert . deepEqual ( buildPropValue ( 'checkbox' , '1' ) , { checkbox : true } ) ;
@@ -327,12 +345,24 @@ describe('buildPropValue', () => {
327345 } ) ;
328346 } ) ;
329347
348+ it ( 'rejects invalid url property' , ( ) => {
349+ assert . deepEqual ( buildPropValue ( 'url' , 'example.com' ) , {
350+ error : 'Invalid URL value: "example.com" (expected http:// or https://)' ,
351+ } ) ;
352+ } ) ;
353+
330354 it ( 'builds email property' , ( ) => {
331355 assert . deepEqual ( buildPropValue ( 'email' , 'user@test.com' ) , {
332356 email : 'user@test.com' ,
333357 } ) ;
334358 } ) ;
335359
360+ it ( 'rejects invalid email property' , ( ) => {
361+ assert . deepEqual ( buildPropValue ( 'email' , 'user.test.com' ) , {
362+ error : 'Invalid email value: "user.test.com" (expected "@" in address)' ,
363+ } ) ;
364+ } ) ;
365+
336366 it ( 'builds phone_number property' , ( ) => {
337367 assert . deepEqual ( buildPropValue ( 'phone_number' , '+1234567890' ) , {
338368 phone_number : '+1234567890' ,
0 commit comments