File tree Expand file tree Collapse file tree 2 files changed +6
-28
lines changed
Expand file tree Collapse file tree 2 files changed +6
-28
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import { idRef } from "../id-ref";
33
44describe ( "idRef" , ( ) => {
55 const TestSchema = z . object ( {
6- domainId : z . string ( ) . uuid ( ) ,
6+ domainId : z . uuid ( ) ,
77 name : z . string ( ) ,
88 } ) ;
99
@@ -18,10 +18,12 @@ describe("idRef", () => {
1818 it ( "should add reference metadata" , ( ) => {
1919 const refField = idRef ( TestSchema , "domainId" , "TestEntity" ) ;
2020
21- // Just verify that the reference can be created and doesn't throw
2221 expect ( refField ) . toBeDefined ( ) ;
23- // We can't easily check the meta properties directly, but we can validate it works
24- expect ( ( ) => refField . parse ( "123e4567-e89b-12d3-a456-426614174000" ) ) . not . toThrow ( ) ;
22+ expect ( z . globalRegistry . has ( refField ) ) . toBe ( true ) ;
23+ expect ( z . globalRegistry . get ( refField ) ) . toEqual ( expect . objectContaining ( {
24+ title : "TestEntity ID Reference" ,
25+ description : "Reference to a TestEntity by its unique identifier" ,
26+ } ) ) ;
2527 } ) ;
2628
2729 it ( "should use custom ID field name when provided" , ( ) => {
You can’t perform that action at this time.
0 commit comments