@@ -19,64 +19,72 @@ describe('EntityParser', () => {
1919
2020 test ( 'should parse entities and extract basic structure' , ( ) => {
2121 const entities = parser . parseAllEntities ( ) ;
22-
22+
2323 // Verify we found entities
2424 expect ( entities . length ) . toBeGreaterThan ( 50 ) ; // Should be around 64 entities
25-
25+
2626 // Find a specific entity to test
27- const accountEntity = entities . find ( e => e . name === 'Account' ) ;
27+ const accountEntity = entities . find ( ( e ) => e . name === 'Account' ) ;
2828 expect ( accountEntity ) . toBeDefined ( ) ;
29-
29+
3030 if ( accountEntity ) {
3131 expect ( accountEntity . name ) . toBe ( 'Account' ) ;
3232 expect ( accountEntity . description ) . toContain ( 'user of Mastodon' ) ;
3333 expect ( accountEntity . attributes . length ) . toBeGreaterThan ( 20 ) ; // Account has many attributes
34-
34+
3535 // Check some specific attributes exist
36- const idAttribute = accountEntity . attributes . find ( attr => attr . name === 'id' ) ;
36+ const idAttribute = accountEntity . attributes . find (
37+ ( attr ) => attr . name === 'id'
38+ ) ;
3739 expect ( idAttribute ) . toBeDefined ( ) ;
3840 expect ( idAttribute ?. type ) . toContain ( 'String' ) ;
39-
40- const usernameAttribute = accountEntity . attributes . find ( attr => attr . name === 'username' ) ;
41+
42+ const usernameAttribute = accountEntity . attributes . find (
43+ ( attr ) => attr . name === 'username'
44+ ) ;
4145 expect ( usernameAttribute ) . toBeDefined ( ) ;
4246 expect ( usernameAttribute ?. type ) . toBe ( 'String' ) ;
4347 }
4448 } ) ;
4549
4650 test ( 'should correctly identify optional and deprecated attributes' , ( ) => {
4751 const entities = parser . parseAllEntities ( ) ;
48-
52+
4953 // Find entities with optional/deprecated attributes
5054 let foundOptional = false ;
5155 let foundDeprecated = false ;
52-
56+
5357 for ( const entity of entities ) {
5458 for ( const attr of entity . attributes ) {
5559 if ( attr . optional ) foundOptional = true ;
5660 if ( attr . deprecated ) foundDeprecated = true ;
5761 }
5862 }
59-
63+
6064 expect ( foundOptional ) . toBe ( true ) ;
6165 expect ( foundDeprecated ) . toBe ( true ) ;
6266 } ) ;
6367
6468 test ( 'should parse entity with simple structure' , ( ) => {
6569 const entities = parser . parseAllEntities ( ) ;
66-
70+
6771 // Find Application entity which has a simpler structure
68- const applicationEntity = entities . find ( e => e . name === 'Application' ) ;
72+ const applicationEntity = entities . find ( ( e ) => e . name === 'Application' ) ;
6973 expect ( applicationEntity ) . toBeDefined ( ) ;
70-
74+
7175 if ( applicationEntity ) {
7276 expect ( applicationEntity . name ) . toBe ( 'Application' ) ;
73- expect ( applicationEntity . description ) . toContain ( 'interfaces with the REST API' ) ;
77+ expect ( applicationEntity . description ) . toContain (
78+ 'interfaces with the REST API'
79+ ) ;
7480 expect ( applicationEntity . attributes . length ) . toBeGreaterThan ( 0 ) ;
75-
81+
7682 // Check that name attribute exists
77- const nameAttribute = applicationEntity . attributes . find ( attr => attr . name === 'name' ) ;
83+ const nameAttribute = applicationEntity . attributes . find (
84+ ( attr ) => attr . name === 'name'
85+ ) ;
7886 expect ( nameAttribute ) . toBeDefined ( ) ;
7987 expect ( nameAttribute ?. type ) . toBe ( 'String' ) ;
8088 }
8189 } ) ;
82- } ) ;
90+ } ) ;
0 commit comments