• 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/Customize/components/CustomHeaderRemover.generated.test.jsx
1
// src/components/PaginatedTable/Customize/components/CustomHeaderRemover.test.jsx
2
import React from 'react';
3
import { render, screen, fireEvent } from '@testing-library/react';
4
import { Provider } from 'react-redux';
5
import CustomHeaderRemover from './CustomHeaderRemover';
6

7
// Minimal mock Redux store for react-redux Provider
8
function makeStore(filesIdValue) {
NEW
9
  return {
×
NEW
10
    getState: () => ({
×
11
      cartReducer: {
12
        filesId: filesIdValue,
13
      },
14
    }),
NEW
15
    subscribe: () => () => {},
×
16
    dispatch: jest.fn(),
17
  };
18
}
19

NEW
20
describe('CustomHeaderRemover', () => {
×
NEW
21
  const getButton = () => screen.getByRole('button');
×
22

NEW
23
  test('should render the Clear Cart button and keep it disabled when filesId in store is empty', () => {
×
NEW
24
    const store = makeStore([]);
×
NEW
25
    render(
×
26
      <Provider store={store}>
27
        <CustomHeaderRemover openDialogBox={jest.fn()} />
28
      </Provider>
29
    );
30

NEW
31
    const button = getButton();
×
NEW
32
    expect(button).not.toBeNull();
×
NEW
33
    expect(button.disabled).toBe(true);
×
NEW
34
    expect(button.textContent).toMatch(/clear cart/i);
×
35
  });
36

NEW
37
  test('should enable the button when filesId has items and call openDialogBox on click', () => {
×
NEW
38
    const store = makeStore(['file-1']);
×
NEW
39
    const openDialogBox = jest.fn();
×
40

NEW
41
    render(
×
42
      <Provider store={store}>
43
        <CustomHeaderRemover openDialogBox={openDialogBox} />
44
      </Provider>
45
    );
46

NEW
47
    const button = getButton();
×
NEW
48
    expect(button.disabled).toBe(false);
×
49

NEW
50
    fireEvent.click(button);
×
NEW
51
    expect(openDialogBox).toHaveBeenCalledTimes(1);
×
52
  });
53

NEW
54
  test('should default filesId to [] when undefined from store and keep button disabled', () => {
×
NEW
55
    const store = makeStore(undefined);
×
NEW
56
    render(
×
57
      <Provider store={store}>
58
        <CustomHeaderRemover openDialogBox={jest.fn()} />
59
      </Provider>
60
    );
61

NEW
62
    const button = getButton();
×
NEW
63
    expect(button.disabled).toBe(true);
×
64
  });
65

NEW
66
  test('should not throw when clicking button if openDialogBox is not provided', () => {
×
NEW
67
    const store = makeStore(['file-1']);
×
NEW
68
    render(
×
69
      <Provider store={store}>
70
        <CustomHeaderRemover />
71
      </Provider>
72
    );
73

NEW
74
    const button = getButton();
×
NEW
75
    expect(button.disabled).toBe(false);
×
76

NEW
77
    expect(() => {
×
NEW
78
      fireEvent.click(button);
×
79
    }).not.toThrow();
80
  });
81
});
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