-
Notifications
You must be signed in to change notification settings - Fork 294
feat: added the ability to close the hint using the keyboard #1812
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
feat: added the ability to close the hint using the keyboard #1812
Conversation
|
Thanks for the pull request, @filippovskii09! This repository is currently maintained by Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review. 🔘 Get product approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. 🔘 Update the status of your PRYour PR is currently marked as a draft. After completing the steps above, update its status by clicking "Ready for Review", or removing "WIP" from the title, as appropriate. Where can I find more information?If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources: When can I expect my changes to be merged?Our goal is to get community contributions seen and reviewed as efficiently as possible. However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1812 +/- ##
==========================================
- Coverage 90.84% 90.84% -0.01%
==========================================
Files 345 345
Lines 5800 5797 -3
Branches 1376 1381 +5
==========================================
- Hits 5269 5266 -3
Misses 514 514
Partials 17 17 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| @@ -0,0 +1,77 @@ | |||
| import React from 'react'; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this import?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
| @@ -0,0 +1,77 @@ | |||
| import React from 'react'; | |||
| import { render } from '@testing-library/react'; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[question]: Is it possible to use function render from file setupTests https://github.com/openedx/frontend-app-learning/blob/master/src/setupTest.js#L222 in these tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, fixed, i used render from setupTest
| @@ -1,3 +1,4 @@ | |||
| import React, { useState } from 'react'; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this React import?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, removed
| @@ -0,0 +1,127 @@ | |||
| import React from 'react'; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this import?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, removed
| @@ -0,0 +1,127 @@ | |||
| import React from 'react'; | |||
| import { render, screen, waitFor } from '@testing-library/react'; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[question]: Is it possible to use function render from file setupTests https://github.com/openedx/frontend-app-learning/blob/master/src/setupTest.js#L222 in these tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, fixed, i used render from setupTest
| import { IntlProvider } from 'react-intl'; | ||
|
|
||
| import { fireEvent } from '@testing-library/dom'; | ||
| import GradeSummaryHeader from './GradeSummaryHeader'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| import { IntlProvider } from 'react-intl'; | |
| import { fireEvent } from '@testing-library/dom'; | |
| import GradeSummaryHeader from './GradeSummaryHeader'; | |
| import { IntlProvider } from 'react-intl'; | |
| import { fireEvent } from '@testing-library/dom'; | |
| import GradeSummaryHeader from './GradeSummaryHeader'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
| name: messages.gradeSummaryTooltipAlt.defaultMessage, | ||
| }); | ||
|
|
||
| fireEvent.click(iconButton); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please replace with use userEvent here
https://testing-library.com/docs/user-event/intro/#difference-to-fireevent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
| expect(screen.getByText(messages.gradeSummaryTooltipBody.defaultMessage)).toBeVisible(); | ||
| }); | ||
|
|
||
| fireEvent.click(iconButton); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please replace with use userEvent here
https://testing-library.com/docs/user-event/intro/#difference-to-fireevent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
| expect(screen.getByText(messages.gradeSummaryTooltipBody.defaultMessage)).toBeInTheDocument(); | ||
| }); | ||
|
|
||
| fireEvent.keyDown(iconButton, { key: 'Escape', code: 'Escape' }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please replace with use userEvent here
https://testing-library.com/docs/user-event/intro/#difference-to-fireevent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
| useSelector: jest.fn(), | ||
| })); | ||
|
|
||
| describe('LiveTab', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain why we are adding these tests to this PR?
It looks like we are proposing accessibility improvements in this PR, but we are writing tests for the functionality of the LiveTab component.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These tests were cherry-picked along with the related changes from a previously closed PR.
The tests themselves are not directly related to the accessibility improvements.
I can separate them if needed, but for now, they ensure we don’t lose existing coverage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but these tests seem to test functionality that is not relevant to this PR. Will we have coverage issues if we remove them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
deleted test and no problem occurred
| import GradeSummaryHeader from './GradeSummaryHeader'; | ||
| import { useModel } from '../../../../generic/model-store'; | ||
| import messages from '../messages'; | ||
| import { initializeMockApp, render } from '../../../../setupTest'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nit]: Please use @src alias
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
| onClick={() => { setShowTooltip(!showTooltip); }} | ||
| onBlur={() => { setShowTooltip(false); }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| onClick={() => { setShowTooltip(!showTooltip); }} | |
| onBlur={() => { setShowTooltip(false); }} | |
| onClick={() => setShowTooltip(!showTooltip)} | |
| onBlur={() => setShowTooltip(false)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
| @@ -0,0 +1,126 @@ | |||
| import { screen, waitFor } from '@testing-library/react'; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
try to import from setupTest.js
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
|
Hi @filippovskii09, thank you for this contribution! Since it's a user-facing change, it will need product approval before it can be merged. Please choose your product contribution type and follow the corresponding instructions to get the product review process started. |
|
@itsjeyd thanks! I plan to create a product proposal and add all of our PRs related to accessibility improvements to it. For now, the PRs will be in draft and awaiting product review |
Description
This PR provides a mechanism to close the tooltip using the keyboard. The escape key is recommended
Testing instructions
2025-10-23.16.57.37.mov