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

CBIIT / bento-icdc-frontend / 26530955228

27 May 2026 06:34PM UTC coverage: 17.321% (-8.4%) from 25.73%
26530955228

Pull #1607

github

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

306 of 2599 branches covered (11.77%)

Branch coverage included in aggregate %.

1 of 4346 new or added lines in 75 files covered. (0.02%)

2 existing lines in 2 files now uncovered.

2197 of 11852 relevant lines covered (18.54%)

0.41 hits per line

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

0.0
/src/components/PaginatedTable/TableTheme.generated.test.js
1
// src/components/PaginatedTable/TableTheme.test.js
2

3
import {
4
  headerTheme,
5
  extendedView,
6
  tablePag,
7
  tblContainer,
8
  customTheme,
9
  themeConfig,
10
} from './TableTheme';
11

NEW
12
describe('TableTheme module', () => {
×
NEW
13
  describe('headerTheme', () => {
×
NEW
14
    it('should use provided primaryColor in tblHeader.MuiTableRow.head.borderBottom', () => {
×
NEW
15
      const color = '#112233';
×
NEW
16
      const theme = headerTheme({ primaryColor: color });
×
NEW
17
      expect(theme.tblHeader.MuiTableRow.head.borderBottom).toBe(
×
18
        `3px solid ${color}`
19
      );
20
      // sanity checks for structure
NEW
21
      expect(theme.tblHeader.MuiTableSortLabel.root.color).toBe('#13344A');
×
NEW
22
      expect(theme.tblHeader.MuiTableCell.root.paddingLeft).toBe('5px');
×
23
    });
24

NEW
25
    it('should use default primaryColor when primaryColor is undefined in argument object', () => {
×
NEW
26
      const theme = headerTheme({}); // primaryColor defaults to '#004c73'
×
NEW
27
      expect(theme.tblHeader.MuiTableRow.head.borderBottom).toBe(
×
28
        '3px solid #004c73'
29
      );
30
    });
31

NEW
32
    it('throws error if called without arguments (cannot destructure undefined)', () => {
×
NEW
33
      expect(() => headerTheme()).toThrow(TypeError);
×
34
    });
35

NEW
36
    it('throws error if called with null (cannot destructure null)', () => {
×
37
      // @ts-expect-error - testing runtime invalid input
NEW
38
      expect(() => headerTheme(null)).toThrow(TypeError);
×
39
    });
40
  });
41

NEW
42
  describe('tblBody (via themeConfig)', () => {
×
NEW
43
    it('exposes tblBody with expected nested rules in composed theme', () => {
×
NEW
44
      const theme = themeConfig({}, {}); // provide empty objects to avoid spread errors
×
NEW
45
      expect(theme.tblBody).toBeDefined();
×
NEW
46
      expect(theme.tblBody.MuiTableCell).toBeDefined();
×
NEW
47
      expect(theme.tblBody.MuiTableCell.root.minHeight).toBe('45px');
×
NEW
48
      expect(theme.tblBody.MuiSvgIcon.root.color).toBe('#0B3556');
×
49
    });
50
  });
51

NEW
52
  describe('extendedView', () => {
×
NEW
53
    it('should use default primaryColor when none provided', () => {
×
NEW
54
      const result = extendedView({});
×
55
      const toolbar =
NEW
56
        result.extendedView.MuiToolbar.root['&.downloadAndColumnView'];
×
NEW
57
      expect(toolbar.borderBottom).toBe('3px solid #FF9742');
×
58
    });
59

NEW
60
    it('should use provided primaryColor', () => {
×
NEW
61
      const color = '#aabbcc';
×
NEW
62
      const result = extendedView({ primaryColor: color });
×
63
      const toolbar =
NEW
64
        result.extendedView.MuiToolbar.root['&.downloadAndColumnView'];
×
NEW
65
      expect(toolbar.borderBottom).toBe(`3px solid ${color}`);
×
66
    });
67

NEW
68
    it('throws error if called without arguments (cannot destructure undefined)', () => {
×
NEW
69
      expect(() => extendedView()).toThrow(TypeError);
×
70
    });
71
  });
72

NEW
73
  describe('tablePag', () => {
×
NEW
74
    it('should apply primaryColor to top and bottom borders', () => {
×
NEW
75
      const color = '#556677';
×
NEW
76
      const result = tablePag({ primaryColor: color });
×
NEW
77
      const root = result.tblPgn.MuiTablePagination.root;
×
NEW
78
      expect(root.borderTop).toBe(`3px solid ${color}`);
×
NEW
79
      expect(root.borderBottom).toBe(`3px solid ${color}`);
×
80
    });
81

NEW
82
    it('should use default primaryColor when missing in argument object', () => {
×
NEW
83
      const result = tablePag({});
×
NEW
84
      const root = result.tblPgn.MuiTablePagination.root;
×
NEW
85
      expect(root.borderTop).toBe('3px solid #004c73');
×
NEW
86
      expect(root.borderBottom).toBe('3px solid #004c73');
×
87
    });
88

NEW
89
    it('throws error if called without arguments (cannot destructure undefined)', () => {
×
NEW
90
      expect(() => tablePag()).toThrow(TypeError);
×
91
    });
92
  });
93

NEW
94
  describe('tblContainer', () => {
×
NEW
95
    it('should apply primaryColor to table borderTop', () => {
×
NEW
96
      const color = '#0099aa';
×
NEW
97
      const result = tblContainer({ primaryColor: color });
×
NEW
98
      expect(result.tblContainer.MuiTable.root.borderTop).toBe(
×
99
        `3px solid ${color}`
100
      );
101
    });
102

NEW
103
    it('should use default primaryColor when missing in argument object', () => {
×
NEW
104
      const result = tblContainer({});
×
NEW
105
      expect(result.tblContainer.MuiTable.root.borderTop).toBe(
×
106
        '3px solid #004c73'
107
      );
108
    });
109

NEW
110
    it('throws error if called without arguments (cannot destructure undefined)', () => {
×
NEW
111
      expect(() => tblContainer()).toThrow(TypeError);
×
112
    });
113
  });
114

NEW
115
  describe('customTheme (static shape)', () => {
×
NEW
116
    it('should expose expected top-level keys and nested rules', () => {
×
NEW
117
      expect(
×
118
        customTheme.MuiButton.root['&.add_selected_button'].backgroundColor
119
      ).toBe('#B35000');
NEW
120
      expect(customTheme.MuiDialog.paper.border).toBe('2px solid #A61401');
×
NEW
121
      expect(customTheme.MuiContainer.root['& img'].width).toBe('17px');
×
122
    });
123
  });
124

NEW
125
  describe('themeConfig (composition)', () => {
×
NEW
126
    it('composes sub-themes and respects primaryColor from styles for header/tbl/pagination', () => {
×
NEW
127
      const stylesColor = '#123456';
×
NEW
128
      const tableColor = '#abcdef';
×
NEW
129
      const theme = themeConfig(
×
130
        { primaryColor: stylesColor },
131
        { primaryColor: tableColor }
132
      );
133

134
      // headerTheme -> uses stylesColor
NEW
135
      expect(theme.tblHeader.MuiTableRow.head.borderBottom).toBe(
×
136
        `3px solid ${stylesColor}`
137
      );
138

139
      // tblContainer -> uses stylesColor
NEW
140
      expect(theme.tblContainer.MuiTable.root.borderTop).toBe(
×
141
        `3px solid ${stylesColor}`
142
      );
143

144
      // tablePag -> uses stylesColor
NEW
145
      expect(theme.tblPgn.MuiTablePagination.root.borderTop).toBe(
×
146
        `3px solid ${stylesColor}`
147
      );
NEW
148
      expect(theme.tblPgn.MuiTablePagination.root.borderBottom).toBe(
×
149
        `3px solid ${stylesColor}`
150
      );
151

152
      // extendedView -> merges styles and table; table primaryColor should win due to spread order
153
      const evToolbar =
NEW
154
        theme.extendedView.MuiToolbar.root['&.downloadAndColumnView'];
×
NEW
155
      expect(evToolbar.borderBottom).toBe(`3px solid ${tableColor}`);
×
156
    });
157

NEW
158
    it('includes tblBody block with expected shape', () => {
×
NEW
159
      const theme = themeConfig(
×
160
        { primaryColor: '#000000' },
161
        { primaryColor: '#ffffff' }
162
      );
NEW
163
      expect(theme.tblBody).toBeDefined();
×
NEW
164
      expect(theme.tblBody.MuiTooltip.tooltip.backgroundColor).toBe('#ffffff');
×
NEW
165
      expect(theme.tblBody.MuiTableCell.body['&.acl'].textAlign).toBe('center');
×
166
    });
167

NEW
168
    it('does not throw when table argument is omitted and uses defaults', () => {
×
NEW
169
      expect(() => themeConfig()).not.toThrow();
×
170

NEW
171
      const theme = themeConfig();
×
172

NEW
173
      expect(theme.tblHeader.MuiTableRow.head.borderBottom).toBe(
×
174
        '3px solid #004c73'
175
      );
NEW
176
      expect(theme.tblContainer.MuiTable.root.borderTop).toBe(
×
177
        '3px solid #004c73'
178
      );
NEW
179
      expect(theme.tblPgn.MuiTablePagination.root.borderTop).toBe(
×
180
        '3px solid #004c73'
181
      );
NEW
182
      expect(theme.tblPgn.MuiTablePagination.root.borderBottom).toBe(
×
183
        '3px solid #004c73'
184
      );
NEW
185
      expect(
×
186
        theme.extendedView.MuiToolbar.root['&.downloadAndColumnView']
187
          .borderBottom
188
      ).toBe('3px solid #FF9742');
189
    });
190

NEW
191
    it('does not throw when table is an empty object', () => {
×
NEW
192
      expect(() => themeConfig({}, {})).not.toThrow();
×
193
    });
194
  });
195
});
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