@@ -58,6 +58,18 @@ describe('Invalid View creation', () => {
5858 } as unknown as View ) ,
5959 ) . toThrowError ( 'View icon is required and must be a valid svg string' )
6060 } )
61+
62+ test ( 'Invalid hidden' , ( ) => {
63+ expect ( ( ) => new View ( {
64+ id : 'test' ,
65+ name : 'Test' ,
66+ order : 1 ,
67+ hidden : 'true' ,
68+ getContents : ( ) => Promise . reject ( new Error ( ) ) ,
69+ } as unknown as View ) ,
70+ ) . toThrowError ( 'View hidden must be a boolean' )
71+ } )
72+
6173 test ( 'Invalid order' , ( ) => {
6274 expect ( ( ) => new View ( {
6375 id : 'test' ,
@@ -157,6 +169,7 @@ describe('View creation', () => {
157169 emptyTitle : 'Test empty title' ,
158170 emptyCaption : 'Test empty caption' ,
159171 getContents : ( ) => Promise . resolve ( { folder, contents : [ ] } ) ,
172+ hidden : true ,
160173 icon : '<svg></svg>' ,
161174 order : 1 ,
162175 params : { } ,
@@ -175,6 +188,7 @@ describe('View creation', () => {
175188 expect ( view . emptyTitle ) . toBe ( 'Test empty title' )
176189 expect ( view . emptyCaption ) . toBe ( 'Test empty caption' )
177190 await expect ( view . getContents ( '/' ) ) . resolves . toStrictEqual ( { folder, contents : [ ] } )
191+ expect ( view . hidden ) . toBe ( true )
178192 expect ( view . icon ) . toBe ( '<svg></svg>' )
179193 expect ( view . order ) . toBe ( 1 )
180194 expect ( view . params ) . toStrictEqual ( { } )
0 commit comments