Skip to content

Commit

Permalink
Merge pull request #614 from kubeshop/610-toggle-testcard-area
Browse files Browse the repository at this point in the history
make whole TestCard trigguer onCollapsed flow #610
  • Loading branch information
cescoferraro authored Jun 1, 2022
2 parents c19285d + 988f219 commit 6ef5bfa
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions web/src/components/TestCard/TestCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,16 @@ const TestCard: React.FC<TTestCardProps> = ({

return (
<S.TestCard $isCollapsed={isCollapsed}>
<S.InfoContainer>
{isCollapsed ? (
<DownOutlined onClick={() => setIsCollapsed(false)} />
) : (
<RightOutlined data-cy={`collapse-test-${testId}`} onClick={onCollapse} />
)}
<S.InfoContainer
onClick={async () => {
if (isCollapsed) {
setIsCollapsed(false);
return;
}
await onCollapse();
}}
>
{isCollapsed ? <DownOutlined /> : <RightOutlined data-cy={`collapse-test-${testId}`} onClick={onCollapse} />}
<S.TextContainer>
<S.NameText>{name}</S.NameText>
</S.TextContainer>
Expand Down

0 comments on commit 6ef5bfa

Please sign in to comment.