Skip to content

Commit bc972fe

Browse files
authored
modify cursor behavior to allow tooltips in report (#625)
1 parent 7ff73ea commit bc972fe

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

client/src/components/TestSuite/TestSuiteDetails/TestGroupListItem/TestGroupListItem.tsx

+5-3
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,12 @@ const TestGroupListItem: FC<TestGroupListItemProps> = ({
112112
disableGutters
113113
elevation={0}
114114
className={classes.accordion}
115-
sx={view === 'report' ? { pointerEvents: 'none' } : {}}
116115
expanded={expanded}
117116
onChange={() => {
118-
setExpanded(!expanded);
119-
setManualExpand(!expanded);
117+
if (view !== 'report') {
118+
setExpanded(!expanded);
119+
setManualExpand(!expanded);
120+
}
120121
}}
121122
slotProps={{ transition: { unmountOnExit: true } }}
122123
onMouseEnter={() => setGroupMouseHover(true)}
@@ -128,6 +129,7 @@ const TestGroupListItem: FC<TestGroupListItemProps> = ({
128129
aria-controls={`${testGroup.id}-detail`}
129130
className={classes.accordionSummary}
130131
expandIcon={view === 'run' && <ExpandMoreIcon tabIndex={0} aria-hidden="false" />}
132+
sx={view === 'report' ? { cursor: 'default !important' } : {}}
131133
>
132134
<Box display="flex" alignItems="center" width="100%">
133135
<Box display="inline-flex">

client/src/components/TestSuite/TestSuiteDetails/TestListItem/TestListItem.tsx

+5-3
Original file line numberDiff line numberDiff line change
@@ -204,16 +204,17 @@ const TestListItem: FC<TestListItemProps> = ({
204204
};
205205

206206
const handleAccordionClick = () => {
207-
setTabIndex(findPopulatedTabIndex());
208-
setOpen(!open);
207+
if (view !== 'report') {
208+
setTabIndex(findPopulatedTabIndex());
209+
setOpen(!open);
210+
}
209211
};
210212

211213
return (
212214
<Accordion
213215
disableGutters
214216
elevation={0}
215217
className={classes.accordion}
216-
sx={view === 'report' ? { pointerEvents: 'none' } : {}}
217218
expanded={open}
218219
slotProps={{ transition: { unmountOnExit: true } }}
219220
onClick={handleAccordionClick}
@@ -247,6 +248,7 @@ const TestListItem: FC<TestListItemProps> = ({
247248
setOpen(!open);
248249
}
249250
}}
251+
sx={view === 'report' ? { cursor: 'default !important' } : {}}
250252
>
251253
<Box display="flex" alignItems="center" width="100%">
252254
{resultIcon}

0 commit comments

Comments
 (0)