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

mendersoftware / gui / 951400782

pending completion
951400782

Pull #3900

gitlab-ci

web-flow
chore: bump @testing-library/jest-dom from 5.16.5 to 5.17.0

Bumps [@testing-library/jest-dom](https://github.com/testing-library/jest-dom) from 5.16.5 to 5.17.0.
- [Release notes](https://github.com/testing-library/jest-dom/releases)
- [Changelog](https://github.com/testing-library/jest-dom/blob/main/CHANGELOG.md)
- [Commits](https://github.com/testing-library/jest-dom/compare/v5.16.5...v5.17.0)

---
updated-dependencies:
- dependency-name: "@testing-library/jest-dom"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Pull Request #3900: chore: bump @testing-library/jest-dom from 5.16.5 to 5.17.0

4446 of 6414 branches covered (69.32%)

8342 of 10084 relevant lines covered (82.73%)

186.0 hits per line

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

85.71
/src/js/components/helptips/baseonboardingtip.js
1
// Copyright 2019 Northern.tech AS
2
//
3
//    Licensed under the Apache License, Version 2.0 (the "License");
4
//    you may not use this file except in compliance with the License.
5
//    You may obtain a copy of the License at
6
//
7
//        http://www.apache.org/licenses/LICENSE-2.0
8
//
9
//    Unless required by applicable law or agreed to in writing, software
10
//    distributed under the License is distributed on an "AS IS" BASIS,
11
//    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
//    See the License for the specific language governing permissions and
13
//    limitations under the License.
14
import React, { useEffect, useState } from 'react';
15
import { connect } from 'react-redux';
16

17
import {
18
  ArrowBack as ArrowBackIcon,
19
  ArrowDownward as ArrowDownwardIcon,
20
  ArrowForward as ArrowForwardIcon,
21
  ArrowUpward as ArrowUpwardIcon
22
} from '@mui/icons-material';
23

24
import { bindActionCreators } from 'redux';
25

26
import { setShowDismissOnboardingTipsDialog } from '../../actions/onboardingActions';
27
import { toggle } from '../../helpers';
28
import Tracking from '../../tracking';
29
import { OnboardingTooltip } from '../common/mendertooltip';
30

31
const iconWidth = 30;
187✔
32

33
export const orientations = {
187✔
34
  top: {
35
    arrow: <ArrowUpwardIcon />,
36
    placement: 'bottom',
37
    offsetStyle: style => {
38
      style.left = style.left - iconWidth / 2;
2✔
39
      return style;
2✔
40
    }
41
  },
42
  right: {
43
    arrow: <ArrowBackIcon />,
44
    placement: 'right',
45
    offsetStyle: style => {
46
      style.top = style.top - iconWidth / 2;
1✔
47
      style.left = style.left + iconWidth / 2;
1✔
48
      return style;
1✔
49
    }
50
  },
51
  bottom: {
52
    arrow: <ArrowDownwardIcon />,
53
    placement: 'top',
54
    offsetStyle: style => {
55
      style.left = style.left - iconWidth / 2;
1✔
56
      return style;
1✔
57
    }
58
  },
59
  left: {
60
    arrow: <ArrowForwardIcon />,
61
    placement: 'left',
62
    offsetStyle: style => {
63
      style.top = style.top - iconWidth / 2;
1✔
64
      return style;
1✔
65
    }
66
  }
67
};
68

69
export const OnboardingIndicator = React.forwardRef(({ className = '', orientation: { arrow, placement }, style = {}, toggle, ...props }, ref) => (
187!
70
  <div className={className} onClick={toggle} ref={ref} style={style} {...props}>
2✔
71
    <div className={`tooltip onboard-icon ${placement}`}>{arrow}</div>
72
  </div>
73
));
74
OnboardingIndicator.displayName = 'OnboardingIndicator';
187✔
75

76
const BaseOnboardingTipComponent = ({
187✔
77
  anchor,
78
  component,
79
  place = 'top',
1✔
80
  progress,
81
  progressTotal = 3,
1✔
82
  id = '1',
×
83
  setShowDismissOnboardingTipsDialog,
84
  ...others
85
}) => {
86
  const [open, setOpen] = useState(true);
1✔
87

88
  useEffect(() => {
1✔
89
    Tracking.event({ category: 'onboarding', action: id });
1✔
90
    setOpen(true);
1✔
91
  }, []);
92

93
  const toggleVisibility = () => setOpen(toggle);
1✔
94

95
  const hide = () => setOpen(false);
1✔
96

97
  const orientation = orientations[place];
1✔
98
  const style = orientation.offsetStyle({ left: anchor.left, top: anchor.top, overflow: 'initial' });
1✔
99

100
  return (
1✔
101
    <OnboardingTooltip
102
      disableFocusListener
103
      disableHoverListener
104
      disableTouchListener
105
      id={id}
106
      onClose={hide}
107
      open={open}
108
      placement={orientation.placement}
109
      PopperProps={{
110
        disablePortal: true,
111
        popperOptions: {
112
          strategy: 'fixed',
113
          modifiers: [
114
            { name: 'flip', enabled: false },
115
            { name: 'preventOverflow', enabled: true, options: { boundary: window, altBoundary: false } }
116
          ]
117
        }
118
      }}
119
      title={
120
        <div className="content">
121
          {React.cloneElement(component, others)}
122
          <div className="flexbox">
123
            {progress ? <div>{`Progress: step ${progress} of ${progressTotal}`}</div> : null}
1!
124
            <div style={{ flexGrow: 1 }} />
125
            <a onClick={() => setShowDismissOnboardingTipsDialog(true)}>Dismiss</a>
×
126
          </div>
127
        </div>
128
      }
129
    >
130
      <OnboardingIndicator className="onboard-tip" orientation={orientation} style={style} toggle={toggleVisibility} />
131
    </OnboardingTooltip>
132
  );
133
};
134

135
const mapDispatchToProps = dispatch => {
187✔
136
  return bindActionCreators({ setShowDismissOnboardingTipsDialog }, dispatch);
1✔
137
};
138

139
export const BaseOnboardingTip = connect(null, mapDispatchToProps)(BaseOnboardingTipComponent);
187✔
140
export default BaseOnboardingTip;
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

© 2025 Coveralls, Inc