@@ -150,6 +150,7 @@ describe("Library Tests", () => {
150150 if ( ! event ) {
151151 throw new Error ( "Event not found" ) ;
152152 }
153+ expect ( event . id ) . toBeTypeOf ( "string" ) ;
153154 expect ( event . types ) . toStrictEqual ( [ "Event" ] ) ;
154155 expect ( event . name ) . toBe ( "Conference" ) ;
155156
@@ -163,40 +164,50 @@ describe("Library Tests", () => {
163164 ) {
164165 throw new Error ( "Participants not found" ) ;
165166 }
167+
168+ expect ( event . participants [ 0 ] . id ) . toBeTypeOf ( "string" ) ;
166169 expect ( event . participants [ 0 ] . types ) . toStrictEqual ( [ "Person" ] ) ;
167170 expect ( event . participants [ 0 ] . name ) . toBe ( "Alice" ) ;
168171 expect ( event . participants [ 0 ] . age ) . toBe ( 30 ) ;
169172 expect ( event . participants [ 0 ] . badges ) . toHaveLength ( 1 ) ;
170173 expect ( event . participants [ 0 ] . badges [ 0 ] . name ) . toBe ( "Speaker" ) ;
171174
175+ expect ( event . participants [ 1 ] . id ) . toBeTypeOf ( "string" ) ;
172176 expect ( event . participants [ 1 ] . types ) . toStrictEqual ( [ "Person" ] ) ;
173177 expect ( event . participants [ 1 ] . name ) . toBe ( "Bob" ) ;
174178 expect ( event . participants [ 1 ] . age ) . toBe ( 25 ) ;
175179 expect ( event . participants [ 1 ] . badges ) . toHaveLength ( 1 ) ;
176180 expect ( event . participants [ 1 ] . badges [ 0 ] . name ) . toBe ( "Attendee" ) ;
177181
178182 // Check author
183+ expect ( event . author . id ) . toBeTypeOf ( "string" ) ;
179184 expect ( event . author . types ) . toStrictEqual ( [ "User" , "Person" ] ) ;
180185 expect ( event . author . name ) . toBe ( "Charlie" ) ;
181186 expect ( event . author . email ) . toBe ( "[email protected] " ) ; 182187
183188 expectTypeOf ( event ) . toMatchTypeOf < {
189+ id : string ;
184190 types : string [ ] ;
185191 name : string ;
186192 participants : {
193+ id : string ;
187194 types : string [ ] ;
188195 name : string ;
189196 age : number ;
190197 badges : {
198+ id : string ;
199+ types : string [ ] ;
191200 name : string ;
192201 } [ ] ;
193202 } [ ] ;
194203 author : {
204+ id : string ;
195205 types : string [ ] ;
196206 name : string ;
197207 age : number ;
198208 email : string ;
199209 badges : {
210+ id : string ;
200211 types : string [ ] ;
201212 name : string ;
202213 } [ ] ;
0 commit comments