File tree Expand file tree Collapse file tree
src/course-home/progress-tab/grades/grade-summary Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -74,7 +74,7 @@ describe('GradeSummaryHeader', () => {
7474 } ) ;
7575 } ) ;
7676
77- it ( 'hides tooltip on blur and hover out (covering setShowTooltip(false)) ' , async ( ) => {
77+ it ( 'hides tooltip on blur' , async ( ) => {
7878 renderComponent ( ) ;
7979
8080 const iconButton = screen . getByRole ( 'button' , {
@@ -88,21 +88,17 @@ describe('GradeSummaryHeader', () => {
8888 expect ( screen . getByText ( messages . gradeSummaryTooltipBody . defaultMessage ) ) . toBeInTheDocument ( ) ;
8989 } ) ;
9090
91- const outside = document . createElement ( 'div ' ) ;
92- document . body . appendChild ( outside ) ;
93- await userEvent . unhover ( iconButton ) ;
94- await userEvent . hover ( outside ) ;
91+ const blurTarget = document . createElement ( 'button ' ) ;
92+ blurTarget . textContent = 'Outside' ;
93+ document . body . appendChild ( blurTarget ) ;
94+ blurTarget . focus ( ) ;
9595
96- const otherButton = document . createElement ( 'button' ) ;
97- otherButton . textContent = 'Other' ;
98- document . body . appendChild ( otherButton ) ;
99- otherButton . focus ( ) ;
96+ await userEvent . unhover ( iconButton ) ;
10097
10198 await waitFor ( ( ) => {
10299 expect ( screen . queryByText ( messages . gradeSummaryTooltipBody . defaultMessage ) ) . not . toBeInTheDocument ( ) ;
103100 } ) ;
104101
105- document . body . removeChild ( outside ) ;
106- document . body . removeChild ( otherButton ) ;
102+ document . body . removeChild ( blurTarget ) ;
107103 } ) ;
108104} ) ;
You can’t perform that action at this time.
0 commit comments