File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -94,11 +94,23 @@ describe('getTemplate', () => {
9494 name ,
9595 registry ,
9696 Object . keys ( uiOptions ) . reduce ( ( uiOptions , key ) => {
97- uiOptions [ key ] = key ;
97+ ( uiOptions as Record < string , any > ) [ key ] = key ;
9898 return uiOptions ;
9999 } , { } )
100100 )
101101 ) . toBe ( FakeTemplate ) ;
102102 } ) ;
103103 } ) ;
104+ it ( 'returns the custom template name from the registry' , ( ) => {
105+ const customTemplateKey = 'CustomTemplate' ;
106+ registry . templates [ customTemplateKey ] = FakeTemplate ;
107+
108+ expect ( getTemplate ( customTemplateKey , registry ) ) . toBe ( FakeTemplate ) ;
109+ } ) ;
110+
111+ it ( 'returns undefined when the custom template is not in the registry' , ( ) => {
112+ const customTemplateKey = 'CustomTemplate' ;
113+
114+ expect ( getTemplate ( customTemplateKey , registry ) ) . toBeUndefined ( ) ;
115+ } ) ;
104116} ) ;
You can’t perform that action at this time.
0 commit comments