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

CBIIT / bento-icdc-frontend / 26531437966

27 May 2026 06:43PM UTC coverage: 17.253% (-8.5%) from 25.73%
26531437966

Pull #1607

github

web-flow
Merge 8713d05ca 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 4403 new or added lines in 76 files covered. (0.02%)

2 existing lines in 2 files now uncovered.

2197 of 11909 relevant lines covered (18.45%)

0.41 hits per line

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

0.0
/src/components/AddToCartDialog/AddToCartDialogView.generated.test.jsx
1
// src/components/AddToCartDialog/AddToCartDialogView.test.jsx
2
import React from 'react';
3
import { render, screen, fireEvent, cleanup } from '@testing-library/react';
4
import AddToCartDialogView from './AddToCartDialogView';
5

NEW
6
jest.mock('./dialogThemeConfig', () => ({
×
7
  __esModule: true,
NEW
8
  default: ({ children }) => <>{children}</>,
×
9
}));
10

NEW
11
jest.mock('@material-ui/core', () => ({
×
12
  __esModule: true,
13
  Dialog: ({ open, children, ...props }) =>
NEW
14
    open ? (
×
15
      <div data-testid="dialog" {...props}>
16
        {children}
17
      </div>
18
    ) : null,
19
  DialogActions: ({ children, ...props }) => (
NEW
20
    <div data-testid="dialog-actions" {...props}>
×
21
      {children}
22
    </div>
23
  ),
24
  DialogContent: ({ children, ...props }) => (
NEW
25
    <div data-testid="dialog-content" {...props}>
×
26
      {children}
27
    </div>
28
  ),
29
  DialogContentText: ({ children, ...props }) => (
NEW
30
    <p data-testid="dialog-content-text" {...props}>
×
31
      {children}
32
    </p>
33
  ),
34
  Button: ({ children, onClick, ...props }) => (
NEW
35
    <button type="button" onClick={onClick} {...props}>
×
36
      {children}
37
    </button>
38
  ),
39
}));
40

NEW
41
afterEach(() => {
×
NEW
42
  cleanup();
×
NEW
43
  jest.clearAllMocks();
×
44
});
45

NEW
46
describe('AddToCartDialogView', () => {
×
NEW
47
  const baseClasses = {
×
48
    popUpWindow: 'popUpWindow',
49
    popUpWindowContent: 'popUpWindowContent',
50
    okButton: 'okButton',
51
    cancelButton: 'cancelButton',
52
  };
53

NEW
54
  const renderComponent = (props = {}) =>
×
NEW
55
    render(
×
56
      <AddToCartDialogView
57
        open={true}
58
        numberOfRowsSelected={{ activeTab: 'Cases', count: 3 }}
59
        onYesClick={() => {}}
60
        onNoClick={() => {}}
61
        classes={baseClasses}
62
        {...props}
63
      />
64
    );
65

NEW
66
  it('renders message for non-"Files" activeTab with correct count', () => {
×
NEW
67
    renderComponent({
×
68
      numberOfRowsSelected: { activeTab: 'Cases', count: 3 },
69
    });
70

NEW
71
    expect(
×
72
      screen.getByText('Add all files for the 3 selected Cases to My Files?')
73
    ).toBeTruthy();
NEW
74
    expect(screen.getByRole('button', { name: 'Yes' })).toBeTruthy();
×
NEW
75
    expect(screen.getByRole('button', { name: 'No' })).toBeTruthy();
×
76
  });
77

NEW
78
  it('renders message for activeTab "Files" with correct count', () => {
×
NEW
79
    renderComponent({
×
80
      numberOfRowsSelected: { activeTab: 'Files', count: 4 },
81
    });
82

NEW
83
    expect(screen.getByText('Add all 4 files to My Files?')).toBeTruthy();
×
84
  });
85

NEW
86
  it('renders no prompt text when numberOfRowsSelected is undefined', () => {
×
NEW
87
    renderComponent({
×
88
      numberOfRowsSelected: undefined,
89
    });
90

NEW
91
    expect(screen.queryByText(/Add all/i)).toBeNull();
×
92
  });
93

NEW
94
  it('falls back to 0 count and "Files" tab when values are missing', () => {
×
NEW
95
    renderComponent({
×
96
      numberOfRowsSelected: { activeTab: undefined, count: undefined },
97
    });
98

NEW
99
    expect(
×
100
      screen.getByText('Add all files for the 0 selected Files to My Files?')
101
    ).toBeTruthy();
102
  });
103

NEW
104
  it('calls onYesClick and onNoClick when respective buttons are clicked', () => {
×
NEW
105
    const onYesClick = jest.fn();
×
NEW
106
    const onNoClick = jest.fn();
×
107

NEW
108
    renderComponent({
×
109
      onYesClick,
110
      onNoClick,
111
    });
112

NEW
113
    fireEvent.click(screen.getByRole('button', { name: 'Yes' }));
×
NEW
114
    expect(onYesClick).toHaveBeenCalledTimes(1);
×
115

NEW
116
    fireEvent.click(screen.getByRole('button', { name: 'No' }));
×
NEW
117
    expect(onNoClick).toHaveBeenCalledTimes(1);
×
118
  });
119

NEW
120
  it('does not render dialog content when open is false', () => {
×
NEW
121
    renderComponent({
×
122
      open: false,
123
    });
124

NEW
125
    expect(screen.queryByRole('button', { name: 'Yes' })).toBeNull();
×
NEW
126
    expect(screen.queryByRole('button', { name: 'No' })).toBeNull();
×
NEW
127
    expect(screen.queryByText(/Add all/i)).toBeNull();
×
128
  });
129
});
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