11import React from 'react' ;
22import thunk from 'redux-thunk' ;
33import configureStore from 'redux-mock-store' ;
4- import { reduxRender , screen , fireEvent , act } from '../../../test-utils' ;
4+ import { reduxRender , screen } from '../../../test-utils' ;
55import { initialTestState } from '../../../testData/testReduxStore' ;
66import CollectionItemRow from './CollectionItemRow' ;
77
@@ -56,9 +56,9 @@ describe('<CollectionItemRow />', () => {
5656 expect ( screen . getByText ( 'testuser' ) ) . toBeInTheDocument ( ) ;
5757 } ) ;
5858
59- it ( 'shows the remove button when user is the owner' , ( ) => {
59+ it ( 'shows the dropdown menu when user is the owner' , ( ) => {
6060 subject ( ) ;
61- expect ( screen . getByRole ( 'button' , { name : / r e m o v e / i } ) ) . toBeInTheDocument ( ) ;
61+ expect ( screen . getByRole ( 'button' , { name : / t o g g l e / i } ) ) . toBeInTheDocument ( ) ;
6262 } ) ;
6363
6464 describe ( 'when user is not the owner' , ( ) => {
@@ -70,24 +70,14 @@ describe('<CollectionItemRow />', () => {
7070 subjectProps = { ...subjectProps , isOwner : true } ;
7171 } ) ;
7272
73- it ( 'does not show the remove button ' , ( ) => {
73+ it ( 'does not show the dropdown menu ' , ( ) => {
7474 subject ( ) ;
7575 expect (
76- screen . queryByRole ( 'button' , { name : / r e m o v e / i } )
76+ screen . queryByRole ( 'button' , { name : / t o g g l e / i } )
7777 ) . not . toBeInTheDocument ( ) ;
7878 } ) ;
7979 } ) ;
8080
81- it ( 'wraps the remove button with a tooltip' , async ( ) => {
82- subject ( ) ;
83-
84- const button = screen . getByRole ( 'button' , { name : / r e m o v e / i } ) ;
85- await act ( async ( ) => {
86- fireEvent . mouseEnter ( button ) ;
87- } ) ;
88- expect ( button ) . toHaveClass ( 'tooltipped' ) ;
89- } ) ;
90-
9181 describe ( 'when the project is deleted' , ( ) => {
9282 beforeAll ( ( ) => {
9383 subjectProps = {
0 commit comments