• 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/OverlayThemConfig.generated.test.js
1
// src/components/OverlayWindow/OverlayThemConfig.test.js
2

3
import React from 'react';
4
import { render, screen, cleanup } from '@testing-library/react';
5
import { createTheme, adaptV4Theme } from '@mui/material/styles';
6
import OverlayWindow from './OverlayThemConfig';
7
import themes from '../../themes';
8

NEW
9
jest.mock('../../themes', () => {
×
NEW
10
  const overrides = {};
×
11

NEW
12
  return {
×
13
    __esModule: true,
14
    default: {
15
      light: {
16
        overrides,
17
      },
18
    },
19
    overrides: {
20
      typography: {
21
        fontSize: 14,
22
      },
23
    },
24
  };
25
});
26

NEW
27
jest.mock('@mui/material/styles', () => {
×
NEW
28
  const React = jest.requireActual('react');
×
29

NEW
30
  const mockCreateTheme = jest.fn(theme => ({
×
31
    __mockTheme: true,
32
    theme,
33
  }));
34

NEW
35
  const mockAdaptV4Theme = jest.fn(theme => ({
×
36
    __adapted: true,
37
    theme,
38
  }));
39

NEW
40
  const ThemeProvider = ({ theme, children }) =>
×
NEW
41
    React.createElement(
×
42
      'div',
43
      {
44
        'data-testid': 'theme-provider',
45
        'data-theme-present': !!theme,
46
      },
47
      children
48
    );
49

NEW
50
  const StyledEngineProvider = ({ children }) =>
×
NEW
51
    React.createElement(React.Fragment, null, children);
×
52

NEW
53
  return {
×
54
    __esModule: true,
55
    ThemeProvider,
56
    StyledEngineProvider,
57
    createTheme: mockCreateTheme,
58
    adaptV4Theme: mockAdaptV4Theme,
59
  };
60
});
61

NEW
62
describe('OverlayWindow', () => {
×
63
  let consoleErrorSpy;
64

NEW
65
  beforeEach(() => {
×
NEW
66
    jest.clearAllMocks();
×
NEW
67
    themes.light.overrides = {};
×
68

NEW
69
    consoleErrorSpy = jest.spyOn(console, 'error').mockImplementation(() => {});
×
70
  });
71

NEW
72
  afterEach(() => {
×
NEW
73
    cleanup();
×
NEW
74
    consoleErrorSpy.mockRestore();
×
75
  });
76

NEW
77
  it('computes the theme and passes it to ThemeProvider', () => {
×
NEW
78
    render(
×
79
      <OverlayWindow>
80
        <div data-testid="child">child</div>
81
      </OverlayWindow>
82
    );
83

NEW
84
    expect(screen.queryByTestId('child')).not.toBeNull();
×
NEW
85
    expect(screen.queryByTestId('theme-provider')).not.toBeNull();
×
86

NEW
87
    expect(adaptV4Theme).toHaveBeenCalledTimes(1);
×
NEW
88
    expect(createTheme).toHaveBeenCalledTimes(1);
×
89

NEW
90
    const adaptArg = adaptV4Theme.mock.calls[0][0];
×
91

NEW
92
    expect(adaptArg).toEqual(
×
93
      expect.objectContaining({
94
        0: expect.objectContaining({
95
          MuiDialog: {
96
            paper: {
97
              width: '770px',
98
              height: '620px',
99
              borderRadius: '5px !important',
100
              backgroundColor: '#ffffff !important',
101
              padding: '0px 20px 0px 20px !important',
102
            },
103
          },
104
          MuiTypography: {
105
            root: {
106
              fontSize: '14px !important',
107
              color: '#000000',
108
            },
109
          },
110
          MuiDialogTitle: {
111
            root: {
112
              padding: '15px 15px 15px 0 !important',
113
              '& h2': {
114
                fontSize: '22px !important',
115
              },
116
            },
117
          },
118
          MuiDialogContent: {
119
            root: {
120
              color: '#000045',
121
              '& p': {
122
                fontSize: '14px',
123
              },
124
              padding: '20px 0px 0px 0px !important',
125
              '& ul': {
126
                marginTop: '0px',
127
                paddingTop: '0px',
128
              },
129
            },
130
          },
131
          MuiButton: {
132
            root: {
133
              width: '133px',
134
              height: '35px',
135
              backgroundColor: '#337ab7',
136
              color: '#fff',
137
              textTransform: 'none',
138
              '&:hover': {
139
                backgroundColor: '#2e6da4',
140
              },
141
            },
142
          },
143
          MuiListI: {
144
            root: {
145
              marginTop: '-15px !important',
146
              fontSize: '14px',
147
            },
148
            padding: {
149
              paddingTop: '0px !important',
150
            },
151
          },
152
          MuiListItem: {
153
            root: {
154
              fontSize: '14px',
155
              padding: '2px 0px 0px 25px !important',
156
            },
157
          },
158
          MuiListItemIcon: {
159
            root: {
160
              marginBottom: 'auto',
161
              fontSize: '12px',
162
              color: '#000000',
163
              width: '10px',
164
              minWidth: '2px',
165
              paddingTop: '10px',
166
            },
167
          },
168
          MuiDialogContentText: {
169
            root: {
170
              color: '#000000',
171
              marginBottom: '10px',
172
              '& p.lastChild': {
173
                marginBottom: '0px',
174
              },
175
            },
176
          },
177
          MuiBackdrop: {
178
            root: {
179
              backgroundColor: '#00000047',
180
            },
181
          },
182
          MuiDialogActions: {
183
            root: {
184
              height: '75px',
185
              justifyContent: 'right !important',
186
              padding: '30px 10px 25px 0px !important',
187
            },
188
          },
189
        }),
190
      })
191
    );
192

NEW
193
    expect(createTheme).toHaveBeenCalledWith(
×
194
      adaptV4Theme.mock.results[0].value
195
    );
196
  });
197

NEW
198
  it('renders safely when children is undefined', () => {
×
NEW
199
    render(<OverlayWindow />);
×
200

NEW
201
    expect(adaptV4Theme).toHaveBeenCalledTimes(1);
×
NEW
202
    expect(createTheme).toHaveBeenCalledTimes(1);
×
NEW
203
    expect(screen.queryByTestId('theme-provider')).not.toBeNull();
×
204
  });
205

NEW
206
  it('overwrites existing override keys on themes.light.overrides', () => {
×
NEW
207
    themes.light.overrides.MuiDialog = {
×
208
      paper: { width: '123px', custom: true },
209
    };
NEW
210
    themes.light.overrides.MuiDialogActions = { root: { height: '10px' } };
×
211

NEW
212
    render(<OverlayWindow />);
×
213

NEW
214
    expect(themes.light.overrides.MuiDialog).toMatchObject({
×
215
      paper: {
216
        width: '770px',
217
        height: '620px',
218
        borderRadius: '5px !important',
219
        backgroundColor: '#ffffff !important',
220
        padding: '0px 20px 0px 20px !important',
221
      },
222
    });
223

NEW
224
    expect(themes.light.overrides.MuiDialogActions).toMatchObject({
×
225
      root: {
226
        height: '75px',
227
        justifyContent: 'right !important',
228
        padding: '30px 10px 25px 0px !important',
229
      },
230
    });
231
  });
232
});
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