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

snowcoders / jest-react-mock-utils / 17519210517

06 Sep 2025 08:29PM UTC coverage: 100.0%. Remained the same
17519210517

Pull #677

github

web-flow
Merge 4f132ebb4 into d058dd3ec
Pull Request #677: Update dependency lint-staged to v16.1.6

2 of 2 branches covered (100.0%)

Branch coverage included in aggregate %.

39 of 39 relevant lines covered (100.0%)

23.03 hits per line

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

100.0
/src/tests-class-component/child-with-children/test-asset.parent.tsx
1
import React, { useState } from "react";
2
import { Child } from "./test-asset.child.js";
3

4
export const parentTestIdMap = {
2✔
5
  clickCount: "click-count",
6
  child: "child",
7
};
8

9
export type ParentProps = Record<keyof any, never>;
10

11
type ParentState = {
12
  clickCount: number;
13
};
14

15
export class Parent extends React.Component<ParentProps, ParentState> {
16
  constructor(props: ParentProps) {
17
    super(props);
12✔
18

19
    this.state = {
12✔
20
      clickCount: 0,
21
    };
22
  }
23

24
  handleChildClick = () => {
12✔
25
    this.setState((value) => ({
8✔
26
      ...value,
27
      clickCount: value.clickCount + 1,
28
    }));
29
  };
30

31
  render() {
32
    const { clickCount } = this.state;
20✔
33
    return (
20✔
34
      <div>
35
        <h1>Real parent</h1>
36
        <div>
37
          Click count is <span data-testid={parentTestIdMap.clickCount}>{clickCount}</span>
38
        </div>
39
        <Child
40
          data-testid={parentTestIdMap.child}
41
          onClick={this.handleChildClick}
42
          someData="someData"
43
          onComplicatedCallback={() => {}}
44
        >
45
          Increment
46
        </Child>
47
      </div>
48
    );
49
  }
50
}
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