@@ -179,41 +179,43 @@ describe('<ActionMenu />', () => {
179179    } ) ; 
180180  } ) ; 
181181
182-   it ( 'uses Button and ButtonGroup as subcomponents' ,  ( )  =>  { 
183-     const  wrapper  =  mountWithApp ( 
184-       < ActionMenu  { ...mockProps }  actions = { mockActions }  /> , 
185-     ) ; 
182+   describe ( '<Actions />' ,  ( )  =>  { 
183+     it ( 'uses Button and ButtonGroup as subcomponents' ,  ( )  =>  { 
184+       const  wrapper  =  mountWithApp ( 
185+         < ActionMenu  { ...mockProps }  actions = { mockActions }  /> , 
186+       ) ; 
186187
187-     expect ( wrapper . findAll ( Button ) ) . toHaveLength ( 2 ) ; 
188-     expect ( wrapper . findAll ( ButtonGroup ) ) . toHaveLength ( 1 ) ; 
189-   } ) ; 
188+       expect ( wrapper . findAll ( Button ) ) . toHaveLength ( 2 ) ; 
189+       expect ( wrapper . findAll ( ButtonGroup ) ) . toHaveLength ( 1 ) ; 
190+     } ) ; 
191+ 
192+     it ( 'passes action callbacks through to Button' ,  ( )  =>  { 
193+       const  spy  =  jest . fn ( ) ; 
194+       const  wrapper  =  mountWithApp ( 
195+         < ActionMenu 
196+           { ...mockProps } 
197+           actions = { [ { content : 'mock' ,  onAction : spy } ] } 
198+         /> , 
199+       ) ; 
190200
191-   it ( 'action callbacks are passed through to Button' ,  ( )  =>  { 
192-     const  spy  =  jest . fn ( ) ; 
193-     const  wrapper  =  mountWithApp ( 
194-       < ActionMenu 
195-         { ...mockProps } 
196-         actions = { [ { content : 'mock' ,  onAction : spy } ] } 
197-       /> , 
198-     ) ; 
201+       wrapper . find ( Button ) ! . trigger ( 'onClick' ) ; 
199202
200-     wrapper . find ( Button ) ! . trigger ( 'onClick' ) ; 
203+       expect ( spy ) . toHaveBeenCalledTimes ( 1 ) ; 
204+     } ) ; 
201205
202-     expect ( spy ) . toHaveBeenCalledTimes ( 1 ) ; 
203-   } ) ; 
206+     it ( 'passes `onActionRollup` if set' ,  ( )  =>  { 
207+       const  onActionRollup  =  jest . fn ( ) ; 
208+       const  wrapper  =  mountWithApp ( 
209+         < ActionMenu 
210+           { ...mockProps } 
211+           actions = { [ { content : 'mock' } ] } 
212+           onActionRollup = { onActionRollup } 
213+         /> , 
214+       ) ; 
204215
205-   it ( 'renders <Actions /> passing `onActionRollup` as prop if it exists' ,  ( )  =>  { 
206-     const  onActionRollup  =  jest . fn ( ) ; 
207-     const  wrapper  =  mountWithApp ( 
208-       < ActionMenu 
209-         { ...mockProps } 
210-         actions = { [ { content : 'mock' } ] } 
211-         onActionRollup = { onActionRollup } 
212-       /> , 
213-     ) ; 
214- 
215-     expect ( wrapper ) . toContainReactComponent ( Actions ,  { 
216-       onActionRollup, 
216+       expect ( wrapper ) . toContainReactComponent ( Actions ,  { 
217+         onActionRollup, 
218+       } ) ; 
217219    } ) ; 
218220  } ) ; 
219221} ) ; 
0 commit comments