• 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/NavBar/NavBarThemeConfig.generated.test.jsx
1
// src/components/NavBar/NavBarThemeConfig.test.jsx
2

3
import React from 'react';
4
import { render, screen } from '@testing-library/react';
5
import { useTheme } from '@material-ui/core/styles';
6

7
// Mock themes module to provide a stable, minimal theme shape for tests
NEW
8
jest.mock('../../themes', () => ({
×
9
  __esModule: true,
10
  default: {
11
    light: {
12
      overrides: {},
13
      palette: { primary: { main: '#000000' } },
14
    },
15
    dark: {},
16
  },
17
  overrides: {
18
    typography: {
19
      h1: { fontSize: '3rem' },
20
    },
21
  },
22
}));
23

24
import NavBarThemeProvider from './NavBarThemeConfig';
25
import themes, { overrides as exportedOverrides } from '../../themes';
26

NEW
27
const ThemeProbe = () => {
×
NEW
28
  const theme = useTheme();
×
NEW
29
  return (
×
30
    <div>
31
      <div data-testid="child">child</div>
32
      <div data-testid="appbar-width">
33
        {theme?.overrides?.MuiAppBar?.root?.width || ''}
×
34
      </div>
35
      <div data-testid="appbar-position">
36
        {theme?.overrides?.MuiAppBar?.positionFixed?.position || ''}
×
37
      </div>
38
      <div data-testid="button-exists">
39
        {theme?.overrides?.MuiButton?.root ? 'true' : ''}
×
40
      </div>
41
      <div data-testid="typography-h1">
42
        {theme?.typography?.h1?.fontSize || ''}
×
43
      </div>
44
    </div>
45
  );
46
};
47

NEW
48
describe('NavBarThemeProvider', () => {
×
NEW
49
  afterEach(() => {
×
NEW
50
    jest.clearAllMocks();
×
NEW
51
    jest.resetModules();
×
52
  });
53

NEW
54
  test('happy path: provides theme with MuiAppBar and MuiButton overrides and renders children', () => {
×
55
    // Arrange & Act
NEW
56
    render(
×
57
      <NavBarThemeProvider>
58
        <ThemeProbe />
59
      </NavBarThemeProvider>
60
    );
61

62
    // Assert (no jest-dom matchers; use plain properties)
NEW
63
    expect(screen.getByTestId('child').textContent).toBe('child');
×
NEW
64
    expect(screen.getByTestId('appbar-width').textContent).toBe(
×
65
      '100% !important'
66
    );
NEW
67
    expect(screen.getByTestId('appbar-position').textContent).toBe('relative');
×
NEW
68
    expect(screen.getByTestId('button-exists').textContent).toBe('true');
×
69
  });
70

NEW
71
  test('merges exported overrides (typography) into the computed theme', () => {
×
72
    // Arrange & Act
NEW
73
    render(
×
74
      <NavBarThemeProvider>
75
        <ThemeProbe />
76
      </NavBarThemeProvider>
77
    );
78

79
    // Assert typography from exported overrides
NEW
80
    expect(screen.getByTestId('typography-h1').textContent).toBe(
×
81
      exportedOverrides.typography.h1.fontSize
82
    );
83
  });
84

NEW
85
  test('mutates themes.light.overrides to include MuiAppBar and MuiButton', () => {
×
86
    // Arrange & Act: render once to trigger mutation
NEW
87
    render(
×
88
      <NavBarThemeProvider>
89
        <div />
90
      </NavBarThemeProvider>
91
    );
92

93
    // Assert side-effects on the mocked themes object
NEW
94
    expect(themes.light.overrides).toBeDefined();
×
NEW
95
    expect(themes.light.overrides.MuiAppBar).toBeDefined();
×
NEW
96
    expect(themes.light.overrides.MuiButton).toBeDefined();
×
97

NEW
98
    expect(themes.light.overrides.MuiAppBar.root.width).toBe('100% !important');
×
NEW
99
    expect(themes.light.overrides.MuiAppBar.positionFixed.position).toBe(
×
100
      'relative'
101
    );
NEW
102
    expect(
×
103
      Object.prototype.hasOwnProperty.call(
104
        themes.light.overrides.MuiButton.root,
105
        '&#button_navbar_mycases'
106
      )
107
    ).toBe(true);
108
  });
109

NEW
110
  test('does not throw when rendered without children (null/edge case)', () => {
×
NEW
111
    expect(() => render(<NavBarThemeProvider />)).not.toThrow();
×
112
  });
113
});
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