• 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/Stats/DashboardStatsController.generated.test.jsx
1
import React from 'react';
2
import { render, screen } from '@testing-library/react';
3
import { useSelector } from 'react-redux';
4
import Stats from './DashboardStatsController';
5

NEW
6
jest.mock('react-redux', () => ({
×
7
  useSelector: jest.fn(),
8
}));
9

NEW
10
jest.mock('@material-ui/core/CircularProgress', () => ({
×
11
  __esModule: true,
NEW
12
  default: () => <div role="progressbar" data-testid="loader" />,
×
13
}));
14

NEW
15
jest.mock('./StatsView', () => ({
×
16
  __esModule: true,
17
  default: props => (
NEW
18
    <div
×
19
      data-testid="stats-view"
20
      data-length={Array.isArray(props.data) ? String(props.data.length) : 'na'}
×
21
    />
22
  ),
23
}));
24

NEW
25
const mockUseSelector = useSelector;
×
26

NEW
27
describe('DashboardStatsController', () => {
×
NEW
28
  afterEach(() => {
×
NEW
29
    jest.clearAllMocks();
×
30
  });
31

NEW
32
  const renderWithState = state => {
×
NEW
33
    mockUseSelector.mockImplementation(selector => selector(state));
×
NEW
34
    return render(<Stats />);
×
35
  };
36

NEW
37
  it('should render loader when stats is an empty array', () => {
×
NEW
38
    renderWithState({ dashboardTab: { stats: [] } });
×
39

NEW
40
    expect(screen.queryByRole('progressbar')).not.toBeNull();
×
NEW
41
    expect(screen.queryByTestId('stats-view')).toBeNull();
×
42
  });
43

NEW
44
  it('should render loader when dashboardTab is missing', () => {
×
NEW
45
    renderWithState({});
×
46

NEW
47
    expect(screen.queryByRole('progressbar')).not.toBeNull();
×
NEW
48
    expect(screen.queryByTestId('stats-view')).toBeNull();
×
49
  });
50

NEW
51
  it('should render loader when stats is null', () => {
×
NEW
52
    renderWithState({ dashboardTab: { stats: null } });
×
53

NEW
54
    expect(screen.queryByRole('progressbar')).not.toBeNull();
×
NEW
55
    expect(screen.queryByTestId('stats-view')).toBeNull();
×
56
  });
57

NEW
58
  it('should render StatsView with data when stats contains items', () => {
×
NEW
59
    const data = [{ id: 1 }, { id: 2 }];
×
60

NEW
61
    renderWithState({ dashboardTab: { stats: data } });
×
62

NEW
63
    const statsView = screen.queryByTestId('stats-view');
×
NEW
64
    expect(statsView).not.toBeNull();
×
NEW
65
    expect(statsView.getAttribute('data-length')).toBe(String(data.length));
×
NEW
66
    expect(screen.queryByRole('progressbar')).toBeNull();
×
67
  });
68

NEW
69
  it('should handle undefined stats by showing loader', () => {
×
NEW
70
    renderWithState({ dashboardTab: { stats: undefined } });
×
71

NEW
72
    expect(screen.queryByRole('progressbar')).not.toBeNull();
×
NEW
73
    expect(screen.queryByTestId('stats-view')).toBeNull();
×
74
  });
75
});
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