• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

CBIIT / crdc-datahub-ui / 15497092546

06 Jun 2025 06:19PM UTC coverage: 65.179% (+2.5%) from 62.708%
15497092546

push

github

web-flow
Merge pull request #726 from CBIIT/CRDCDH-2817

CRDCDH-2817 Vite/Vitest Migration & Upgrade dependencies

3529 of 3882 branches covered (90.91%)

Branch coverage included in aggregate %.

167 of 224 new or added lines in 82 files covered. (74.55%)

7620 existing lines in 126 files now uncovered.

22012 of 35304 relevant lines covered (62.35%)

101.98 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

95.24
/src/components/AddRemoveButton.tsx
1
import { Button, ButtonProps, Stack, StackProps, styled, TooltipProps } from "@mui/material";
1✔
2
import { FC } from "react";
3
import StyledTooltip from "./StyledFormComponents/StyledTooltip";
1✔
4

5
const ActionButton = styled(Button, {
1✔
6
  shouldForwardProp: (prop) => prop !== "textColor" && prop !== "iconColor",
1✔
7
})<Props>`
1✔
8
  font-weight: 700;
9
  font-size: 15px;
10
  font-family: "Nunito", "Rubik", sans-serif;
11
  line-height: 16px;
12
  color: ${(props) => props.textColor ?? "#000000"};
1✔
13
  padding: 0;
14
  justify-content: end;
15
  min-width: 143px;
16
  border: none !important;
17
  background: transparent;
18
  text-transform: none;
19
  &.Mui-disabled {
20
    cursor: not-allowed;
21
    pointer-events: auto;
22
  }
23
  & .MuiButton-startIcon {
24
    color: ${(props) => props.iconColor ?? "#44A759"};
1✔
25
    margin-right: 4px;
26
    & svg {
27
      font-size: 23px;
28
    }
29
  }
30
  &:hover {
31
    background: none;
32
  }
33
`;
34

35
const CustomTooltip = (props: TooltipProps) => (
1✔
36
  <StyledTooltip
40✔
37
    {...props}
40✔
38
    slotProps={{
40✔
39
      popper: {
40✔
40
        modifiers: [
40✔
41
          {
40✔
42
            name: "offset",
40✔
43
            options: {
40✔
44
              offset: [0, -2],
40✔
45
            },
40✔
46
          },
40✔
47
        ],
48
      },
40✔
49
    }}
40✔
50
  />
51
);
52

53
type Props = ButtonProps & {
54
  label?: string;
55
  placement?: StackProps["justifyContent"];
56
  iconColor?: string;
57
  textColor?: string;
58
  tooltipProps?: Omit<TooltipProps, "children">;
59
};
60

61
const AddRemoveButton: FC<Props> = ({
1✔
62
  label,
40✔
63
  placement = "end",
40✔
64
  disabled,
40✔
65
  onClick,
40✔
66
  tooltipProps,
40✔
67
  ...rest
40✔
68
}) => {
40✔
69
  const onClickWrapper = (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => {
40✔
70
    if (disabled) {
1!
71
      return;
×
UNCOV
72
    }
×
73
    if (typeof onClick === "function") {
1✔
74
      onClick(event);
1✔
75
    }
1✔
76
  };
1✔
77

78
  return (
40✔
79
    <Stack direction="row" justifyContent={placement} alignItems="center">
40✔
80
      <CustomTooltip title="" {...tooltipProps}>
40✔
81
        <span>
40✔
82
          <ActionButton
40✔
83
            variant="outlined"
40✔
84
            type="button"
40✔
85
            size="small"
40✔
86
            onClick={onClickWrapper}
40✔
87
            disableRipple
40✔
88
            disabled={disabled}
40✔
89
            {...rest}
40✔
90
          >
91
            {label}
40✔
92
          </ActionButton>
40✔
93
        </span>
40✔
94
      </CustomTooltip>
40✔
95
    </Stack>
40✔
96
  );
97
};
40✔
98

99
export default AddRemoveButton;
1✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc