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

MarkUsProject / Markus / 16159140256

09 Jul 2025 02:51AM UTC coverage: 91.993%. Remained the same
16159140256

Pull #7592

github

web-flow
Merge fb60fac59 into d1fa0e71a
Pull Request #7592: Refactor DropDownMenu class to a new React component

643 of 1381 branches covered (46.56%)

Branch coverage included in aggregate %.

10 of 11 new or added lines in 1 file covered. (90.91%)

41983 of 44955 relevant lines covered (93.39%)

118.4 hits per line

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

93.33
/app/javascript/Components/Result/dropdown_menu.jsx
1
import React from "react";
2
import PropTypes from "prop-types";
3

4
import safe_marked from "../../common/safe_marked";
5

6
export class DropDownMenu extends React.Component {
7
  constructor(props) {
8
    super(props);
7✔
9
    this.state = {expanded: false};
7✔
10
  }
11

12
  handleMouseEnter = () => {
7✔
13
    this.setState({expanded: true});
5✔
14
  };
15

16
  handleMouseLeave = () => {
7✔
17
    this.setState({expanded: false});
1✔
18
  };
19

20
  render() {
21
    return (
13✔
22
      <li
23
        className="dropdown_menu"
24
        onMouseEnter={this.handleMouseEnter}
25
        onMouseLeave={this.handleMouseLeave}
NEW
26
        onMouseDown={e => e.preventDefault()}
×
27
      >
28
        <div className="dropdown-header">{this.props.header}</div>
29

30
        {this.state.expanded && (
18✔
31
          <ul>
32
            {this.props.items.map(item => (
33
              <li
15✔
34
                key={item.id}
35
                data-testid={`item-${item.id}`}
36
                onClick={e => {
37
                  e.preventDefault();
1✔
38
                  this.props.addExistingAnnotation(item.id);
1✔
39
                }}
40
              >
41
                <span
42
                  className={"text-content"}
43
                  dangerouslySetInnerHTML={{__html: safe_marked(item.content).slice(0, 70)}}
44
                />
45
                <span className={"red-text"}>{!item.deduction ? "" : "-" + item.deduction}</span>
15✔
46
              </li>
47
            ))}
48
          </ul>
49
        )}
50
      </li>
51
    );
52
  }
53
}
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