Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: refactor tests
  • Loading branch information
vladislavkeblysh authored and filippovskii09 committed Oct 23, 2025
commit 152e9bd1f1ac73a3f90c1cb1ce51ea9159ecbc01
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import {
IconButton,
} from '@openedx/paragon';
import { InfoOutline, Locked } from '@openedx/paragon/icons';
import { useContextId } from '../../../../data/hooks';

import { useContextId } from '../../../../data/hooks';
import messages from '../messages';
import { useModel } from '../../../../generic/model-store';

Expand All @@ -35,8 +35,9 @@ const GradeSummaryHeader = ({ allOfSomeAssignmentTypeIsLocked }) => {
<Stack direction="horizontal" gap={2}>
<h3 className="h4 m-0">{intl.formatMessage(messages.gradeSummary)}</h3>
<OverlayTrigger
trigger="hover"
trigger="click"
placement="top"
show={showTooltip}
overlay={(
<Tooltip>
{intl.formatMessage(messages.gradeSummaryTooltipBody)}
Expand All @@ -48,9 +49,9 @@ const GradeSummaryHeader = ({ allOfSomeAssignmentTypeIsLocked }) => {
onBlur={() => { setShowTooltip(false); }}
onKeyDown={handleKeyDown}
alt={intl.formatMessage(messages.gradeSummaryTooltipAlt)}
src={InfoOutline}
className="mb-3"
iconAs={InfoOutline}
size="sm"
disabled={gradesFeatureIsFullyLocked}
/>
</OverlayTrigger>
</Stack>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,20 +54,20 @@ describe('GradeSummaryHeader', () => {
});
});

it('hides tooltip on mouse out', async () => {
it('hides tooltip on click', async () => {
renderComponent();

const iconButton = screen.getByRole('button', {
name: messages.gradeSummaryTooltipAlt.defaultMessage,
});

fireEvent.mouseOver(iconButton);
fireEvent.click(iconButton);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed


await waitFor(() => {
expect(screen.getByText(messages.gradeSummaryTooltipBody.defaultMessage)).toBeVisible();
});

fireEvent.mouseOut(iconButton);
fireEvent.click(iconButton);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed


await waitFor(() => {
expect(screen.queryByText(messages.gradeSummaryTooltipBody.defaultMessage)).toBeNull();
Expand Down