File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
src/course-home/progress-tab/grades/grade-summary Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -101,4 +101,27 @@ describe('GradeSummaryHeader', () => {
101
101
102
102
document . body . removeChild ( blurTarget ) ;
103
103
} ) ;
104
+
105
+ it ( 'hides tooltip when Escape is pressed (covers handleKeyDown)' , async ( ) => {
106
+ renderComponent ( ) ;
107
+
108
+ const iconButton = screen . getByRole ( 'button' , {
109
+ name : messages . gradeSummaryTooltipAlt . defaultMessage ,
110
+ } ) ;
111
+
112
+ await userEvent . hover ( iconButton ) ;
113
+ await userEvent . click ( iconButton ) ;
114
+
115
+ await waitFor ( ( ) => {
116
+ expect ( screen . getByText ( messages . gradeSummaryTooltipBody . defaultMessage ) ) . toBeInTheDocument ( ) ;
117
+ } ) ;
118
+
119
+ fireEvent . keyDown ( iconButton , { key : 'Escape' , code : 'Escape' } ) ;
120
+
121
+ await userEvent . unhover ( iconButton ) ;
122
+
123
+ await waitFor ( ( ) => {
124
+ expect ( screen . queryByText ( messages . gradeSummaryTooltipBody . defaultMessage ) ) . not . toBeInTheDocument ( ) ;
125
+ } ) ;
126
+ } ) ;
104
127
} ) ;
You can’t perform that action at this time.
0 commit comments