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

CBIIT / bento-icdc-frontend / 26521483403

27 May 2026 03:36PM UTC coverage: 17.458% (-8.3%) from 25.73%
26521483403

Pull #1607

github

web-flow
Merge 2f30510ff into bc935f39c
Pull Request #1607: Feature/ai test studio - ICDC-4165 & ICDC-4171

306 of 2587 branches covered (11.83%)

Branch coverage included in aggregate %.

1 of 4244 new or added lines in 74 files covered. (0.02%)

2 existing lines in 2 files now uncovered.

2197 of 11750 relevant lines covered (18.7%)

0.41 hits per line

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

0.0
/src/components/ReadMeDialog/ReadMe.controller.generated.test.jsx
1
// src/components/ReadMeDialog/ReadMe.controller.test.jsx
2
import React from 'react';
3
import { render, screen, fireEvent, cleanup } from '@testing-library/react';
4
import ReadMeController from './ReadMe.controller.jsx';
5

NEW
6
jest.mock('./ReadMe.component', () => ({
×
7
  __esModule: true,
8
  default: props => (
NEW
9
    <div
×
10
      data-testid="readme-component"
11
      data-title={props.title}
12
      data-content={props.content}
13
      data-display={String(Boolean(props.display))}
14
    >
15
      <button
16
        type="button"
17
        data-testid="readme-action"
18
        onClick={props.displayReadMeDialog}
19
      >
20
        action
21
      </button>
22
    </div>
23
  ),
24
}));
25

NEW
26
afterEach(() => {
×
NEW
27
  jest.clearAllMocks();
×
NEW
28
  cleanup();
×
29
});
30

NEW
31
describe('ReadMeController', () => {
×
NEW
32
  describe('when content is falsy', () => {
×
NEW
33
    const commonProps = {
×
34
      display: true,
35
      displayReadMeDialog: jest.fn(),
36
      config: { readMeTitle: 'Some Title' },
37
    };
38

NEW
39
    test.each([
×
40
      ['undefined', undefined],
41
      ['null', null],
42
      ['empty string', ''],
43
      ['false boolean', false],
44
      ['zero number', 0],
45
    ])('renders nothing when content is %s', (_label, content) => {
NEW
46
      const { container } = render(
×
47
        <ReadMeController {...commonProps} content={content} />
48
      );
49

NEW
50
      expect(container.firstChild).toBeNull();
×
NEW
51
      expect(screen.queryByTestId('readme-component')).toBeNull();
×
52
    });
53
  });
54

NEW
55
  describe('when content is provided', () => {
×
NEW
56
    const content = '# My Readme';
×
57

NEW
58
    it('renders ReadMeComponent with the correct props and title from config', () => {
×
NEW
59
      render(
×
60
        <ReadMeController
61
          display={true}
62
          displayReadMeDialog={jest.fn()}
63
          config={{ readMeTitle: 'README Title' }}
64
          content={content}
65
        />
66
      );
67

NEW
68
      const readme = screen.getByTestId('readme-component');
×
NEW
69
      expect(readme).not.toBeNull();
×
NEW
70
      expect(readme.getAttribute('data-title')).toBe('README Title');
×
NEW
71
      expect(readme.getAttribute('data-content')).toBe(content);
×
NEW
72
      expect(readme.getAttribute('data-display')).toBe('true');
×
73
    });
74

NEW
75
    it('passes display=false through to ReadMeComponent', () => {
×
NEW
76
      render(
×
77
        <ReadMeController
78
          display={false}
79
          displayReadMeDialog={jest.fn()}
80
          config={{ readMeTitle: 'Hidden?' }}
81
          content={content}
82
        />
83
      );
84

NEW
85
      const readme = screen.getByTestId('readme-component');
×
NEW
86
      expect(readme.getAttribute('data-display')).toBe('false');
×
87
    });
88

NEW
89
    it('passes displayReadMeDialog through to the child component', () => {
×
NEW
90
      const displayReadMeDialog = jest.fn();
×
91

NEW
92
      render(
×
93
        <ReadMeController
94
          display={true}
95
          displayReadMeDialog={displayReadMeDialog}
96
          config={{ readMeTitle: 'Title' }}
97
          content={content}
98
        />
99
      );
100

NEW
101
      fireEvent.click(screen.getByTestId('readme-action'));
×
NEW
102
      expect(displayReadMeDialog).toHaveBeenCalledTimes(1);
×
103
    });
104
  });
105

NEW
106
  describe('error handling', () => {
×
NEW
107
    it('throws when config is undefined while content is provided', () => {
×
NEW
108
      expect(() =>
×
NEW
109
        render(
×
110
          <ReadMeController
111
            display={true}
112
            displayReadMeDialog={jest.fn()}
113
            config={undefined}
114
            content="Some content"
115
          />
116
        )
117
      ).toThrow(TypeError);
118
    });
119

NEW
120
    it('does not throw when config is undefined but content is falsy', () => {
×
NEW
121
      const { container } = render(
×
122
        <ReadMeController
123
          display={true}
124
          displayReadMeDialog={jest.fn()}
125
          config={undefined}
126
          content=""
127
        />
128
      );
129

NEW
130
      expect(container.firstChild).toBeNull();
×
131
    });
132
  });
133
});
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