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

CBIIT / bento-icdc-frontend / 26519274266

27 May 2026 02:57PM UTC coverage: 17.458% (-8.3%) from 25.73%
26519274266

push

github

web-flow
Merge pull request #1606 from CBIIT/feature/ai-test-studio

core components unit test

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/OverlayWindow/OverlayWindow.generated.test.jsx
1
// src/components/OverlayWindow/OverlayWindow.test.jsx
2
import React from 'react';
3
import { render, screen, within, fireEvent } from '@testing-library/react';
4
import OverlayWindow from './OverlayWindow';
5

NEW
6
jest.mock('./OverlayText', () => ({
×
7
  __esModule: true,
8
  text: {
9
    content: ['Line A', 'Line B'],
10
    list: ['Item 1', 'Item 2', 'Item 3'],
11
  },
12
}));
13

NEW
14
jest.mock('./OverlayThemConfig', () => {
×
NEW
15
  const MockDialogThemeProvider = ({ children }) => <>{children}</>;
×
16

NEW
17
  MockDialogThemeProvider.displayName = 'MockDialogThemeProvider';
×
18

NEW
19
  return {
×
20
    __esModule: true,
21
    default: MockDialogThemeProvider,
22
  };
23
});
24

NEW
25
jest.mock('@mui/icons-material/FiberManualRecord', () => {
×
NEW
26
  const MockFiberManualRecord = () => <span data-testid="dot" />;
×
27

NEW
28
  MockFiberManualRecord.displayName = 'MockFiberManualRecord';
×
29

NEW
30
  return {
×
31
    __esModule: true,
32
    default: MockFiberManualRecord,
33
  };
34
});
35

NEW
36
describe('OverlayWindow', () => {
×
NEW
37
  test('renders dialog with title and content when open is true', () => {
×
NEW
38
    const handleClose = jest.fn();
×
39

NEW
40
    render(<OverlayWindow open={true} handleClose={handleClose} />);
×
41

NEW
42
    expect(screen.getByRole('dialog')).toBeTruthy();
×
NEW
43
    expect(screen.getByText('Warning')).toBeTruthy();
×
NEW
44
    expect(screen.getByText('Line A')).toBeTruthy();
×
NEW
45
    expect(screen.getByText('Line B')).toBeTruthy();
×
46

NEW
47
    expect(
×
48
      screen.getByText(
49
        /By using this system, you understand and consent to the following/i
50
      )
51
    ).toBeTruthy();
52

NEW
53
    const list = screen.getByRole('list');
×
NEW
54
    const items = within(list).getAllByRole('listitem');
×
NEW
55
    expect(items).toHaveLength(3);
×
56

NEW
57
    const dots = screen.getAllByTestId('dot');
×
NEW
58
    expect(dots).toHaveLength(3);
×
59
  });
60

NEW
61
  test('calls handleClose when Continue button is clicked', () => {
×
NEW
62
    const handleClose = jest.fn();
×
63

NEW
64
    render(<OverlayWindow open={true} handleClose={handleClose} />);
×
65

NEW
66
    fireEvent.click(screen.getByRole('button', { name: /continue/i }));
×
67

NEW
68
    expect(handleClose).toHaveBeenCalledTimes(1);
×
69
  });
70

NEW
71
  test('does not render dialog when open is false', () => {
×
NEW
72
    render(<OverlayWindow open={false} handleClose={jest.fn()} />);
×
73

NEW
74
    expect(screen.queryByRole('dialog')).toBeNull();
×
NEW
75
    expect(screen.queryByText('Warning')).toBeNull();
×
NEW
76
    expect(screen.queryByRole('button', { name: /continue/i })).toBeNull();
×
77
  });
78

NEW
79
  test('renders safely when handleClose is missing', () => {
×
NEW
80
    render(<OverlayWindow open={true} />);
×
81

NEW
82
    expect(screen.getByText('Warning')).toBeTruthy();
×
NEW
83
    expect(screen.getByText('Line A')).toBeTruthy();
×
NEW
84
    expect(screen.getByRole('button', { name: /continue/i })).toBeTruthy();
×
85
  });
86

NEW
87
  test('does not render anything when open is omitted', () => {
×
NEW
88
    render(<OverlayWindow />);
×
89

NEW
90
    expect(screen.queryByRole('dialog')).toBeNull();
×
NEW
91
    expect(screen.queryByText('Warning')).toBeNull();
×
92
  });
93

NEW
94
  test('has the expected accessibility attributes', () => {
×
NEW
95
    render(<OverlayWindow open={true} handleClose={jest.fn()} />);
×
96

NEW
97
    const dialog = screen.getByRole('dialog');
×
NEW
98
    expect(dialog.getAttribute('aria-labelledby')).toBe('alert-dialog-title');
×
NEW
99
    expect(dialog.getAttribute('aria-describedby')).toBe(
×
100
      'alert-dialog-description'
101
    );
102

NEW
103
    expect(document.getElementById('alert-dialog-title')).toBeTruthy();
×
NEW
104
    expect(
×
105
      document.querySelectorAll('#alert-dialog-description').length
106
    ).toBeGreaterThan(0);
107
  });
108
});
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