@@ -11,6 +11,7 @@ const Wrapper = ({ children }: { children: ReactNode }) => (
11
11
</ RecoilRoot >
12
12
) ;
13
13
14
+ // Split into tests for each new hook
14
15
describe ( 'useObjectMetadataItem' , ( ) => {
15
16
it ( 'should return correct properties' , async ( ) => {
16
17
const { result } = renderHook (
@@ -20,39 +21,8 @@ describe('useObjectMetadataItem', () => {
20
21
} ,
21
22
) ;
22
23
23
- const {
24
- basePathToShowPage,
25
- objectMetadataItem,
26
- labelIdentifierFieldMetadata,
27
- getRecordFromCache,
28
- findManyRecordsQuery,
29
- findOneRecordQuery,
30
- createOneRecordMutation,
31
- updateOneRecordMutation,
32
- deleteOneRecordMutation,
33
- executeQuickActionOnOneRecordMutation,
34
- createManyRecordsMutation,
35
- deleteManyRecordsMutation,
36
- mapToObjectRecordIdentifier,
37
- getObjectOrderByField,
38
- } = result . current ;
24
+ const { objectMetadataItem } = result . current ;
39
25
40
- expect ( labelIdentifierFieldMetadata ) . toBeUndefined ( ) ;
41
- expect ( basePathToShowPage ) . toBe ( '/object/opportunity/' ) ;
42
26
expect ( objectMetadataItem . id ) . toBe ( '20202020-cae9-4ff4-9579-f7d9fe44c937' ) ;
43
- expect ( typeof getRecordFromCache ) . toBe ( 'function' ) ;
44
- expect ( typeof mapToObjectRecordIdentifier ) . toBe ( 'function' ) ;
45
- expect ( typeof getObjectOrderByField ) . toBe ( 'function' ) ;
46
- expect ( findManyRecordsQuery ) . toHaveProperty ( 'kind' , 'Document' ) ;
47
- expect ( findOneRecordQuery ) . toHaveProperty ( 'kind' , 'Document' ) ;
48
- expect ( createOneRecordMutation ) . toHaveProperty ( 'kind' , 'Document' ) ;
49
- expect ( updateOneRecordMutation ) . toHaveProperty ( 'kind' , 'Document' ) ;
50
- expect ( deleteOneRecordMutation ) . toHaveProperty ( 'kind' , 'Document' ) ;
51
- expect ( executeQuickActionOnOneRecordMutation ) . toHaveProperty (
52
- 'kind' ,
53
- 'Document' ,
54
- ) ;
55
- expect ( createManyRecordsMutation ) . toHaveProperty ( 'kind' , 'Document' ) ;
56
- expect ( deleteManyRecordsMutation ) . toHaveProperty ( 'kind' , 'Document' ) ;
57
27
} ) ;
58
28
} ) ;
0 commit comments