@@ -267,4 +267,34 @@ describe('Cells', () => {
267267 expect ( screen . queryByText ( 'Very Low' ) ) . not . toBeInTheDocument ( ) ;
268268 } ) ;
269269 } ) ;
270+
271+ describe ( 'MoreMenuCell' , ( ) => {
272+ it ( 'dispatches the actions to open the Edit Patient dialog for the patient' , async ( ) => {
273+ renderComponent ( < MoreMenuCell patient = { patient } /> ) ;
274+
275+ expect ( screen . queryByRole ( 'button' , { name : / E d i t P a t i e n t D e t a i l s / } ) ) . not . toBeInTheDocument ( ) ;
276+ await userEvent . click ( screen . getByTestId ( 'action-menu-patient-1-icon' ) ) ;
277+
278+ await userEvent . click ( screen . getByRole ( 'button' , { name : / E d i t P a t i e n t D e t a i l s / } ) ) ;
279+
280+ expect ( store . getActions ( ) ) . toStrictEqual ( [
281+ { type : 'tideDashboard/setEditPatientDialogIsOpen' , payload : true } ,
282+ { type : 'tideDashboard/setEditPatientDialogPatientId' , payload : 'patient-1' } ,
283+ ] ) ;
284+ } ) ;
285+
286+ it ( 'dispatches the actions to open the Data Connections modal for the patient' , async ( ) => {
287+ renderComponent ( < MoreMenuCell patient = { patient } /> ) ;
288+
289+ expect ( screen . queryByRole ( 'button' , { name : / B r i n g D a t a i n t o T i d e p o o l / } ) ) . not . toBeInTheDocument ( ) ;
290+ await userEvent . click ( screen . getByTestId ( 'action-menu-patient-1-icon' ) ) ;
291+
292+ await userEvent . click ( screen . getByRole ( 'button' , { name : / B r i n g D a t a i n t o T i d e p o o l / } ) ) ;
293+
294+ expect ( store . getActions ( ) ) . toStrictEqual ( [
295+ { type : 'tideDashboard/setDataConnectionsModalIsOpen' , payload : true } ,
296+ { type : 'tideDashboard/setDataConnectionsModalPatientId' , payload : 'patient-1' } ,
297+ ] ) ;
298+ } ) ;
299+ } ) ;
270300} ) ;
0 commit comments