• 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/CustomIcon/CustomIconView.generated.test.jsx
1
// src/components/CustomIcon/CustomIconView.test.jsx
2
import React from 'react';
3
import { render, cleanup } from '@testing-library/react';
4
import CustomIconView from './CustomIconView';
5

NEW
6
const expectElement = (element, message) => {
×
NEW
7
  if (!element) {
×
NEW
8
    throw new Error(message);
×
9
  }
NEW
10
  return element;
×
11
};
12

NEW
13
afterEach(() => {
×
NEW
14
  cleanup();
×
15
});
16

NEW
17
describe('CustomIconView', () => {
×
NEW
18
  it('renders an img with the default alt text and provided src', () => {
×
NEW
19
    const { container } = render(<CustomIconView imgSrc="mock-flag.png" />);
×
20

NEW
21
    const iconEl = container.querySelector('.MuiIcon-root');
×
NEW
22
    const img = container.querySelector('img[alt="Logo alt text"]');
×
23

NEW
24
    expect(iconEl).not.toBeNull();
×
NEW
25
    expect(img).not.toBeNull();
×
26

NEW
27
    const imgEl = expectElement(img, 'Expected image element to be rendered');
×
NEW
28
    expect(imgEl.getAttribute('src')).toBe('mock-flag.png');
×
NEW
29
    expect(imgEl.getAttribute('alt')).toBe('Logo alt text');
×
30
  });
31

NEW
32
  it('uses the provided imgAlt instead of the default', () => {
×
NEW
33
    const { container } = render(
×
34
      <CustomIconView imgSrc="mock-flag.png" imgAlt="Custom Alt" />
35
    );
36

NEW
37
    const img = container.querySelector('img[alt="Custom Alt"]');
×
38

NEW
39
    expect(img).not.toBeNull();
×
40

NEW
41
    const imgEl = expectElement(img, 'Expected image element to be rendered');
×
NEW
42
    expect(imgEl.getAttribute('src')).toBe('mock-flag.png');
×
NEW
43
    expect(imgEl.getAttribute('alt')).toBe('Custom Alt');
×
44
  });
45

NEW
46
  it('wraps the image inside a Material-UI Icon element', () => {
×
NEW
47
    const { container } = render(<CustomIconView imgSrc="mock-flag.png" />);
×
48

NEW
49
    const iconEl = container.querySelector('.MuiIcon-root');
×
NEW
50
    const img = container.querySelector('img[alt="Logo alt text"]');
×
51

NEW
52
    expect(iconEl).not.toBeNull();
×
NEW
53
    expect(img).not.toBeNull();
×
54

NEW
55
    const iconNode = expectElement(iconEl, 'Expected Material-UI Icon wrapper');
×
NEW
56
    const imgNode = expectElement(img, 'Expected image element to be rendered');
×
NEW
57
    expect(iconNode.contains(imgNode)).toBe(true);
×
58
  });
59

NEW
60
  it('handles undefined imgSrc gracefully by omitting the src attribute', () => {
×
NEW
61
    const { container } = render(<CustomIconView />);
×
62

NEW
63
    const img = container.querySelector('img[alt="Logo alt text"]');
×
64

NEW
65
    expect(img).not.toBeNull();
×
66

NEW
67
    const imgNode = expectElement(img, 'Expected image element to be rendered');
×
NEW
68
    expect(imgNode.hasAttribute('src')).toBe(false);
×
NEW
69
    expect(imgNode.getAttribute('alt')).toBe('Logo alt text');
×
70
  });
71

NEW
72
  it('applies the generated withStyles class to the image', () => {
×
NEW
73
    const { container } = render(<CustomIconView imgSrc="mock-flag.png" />);
×
74

NEW
75
    const img = container.querySelector('img[alt="Logo alt text"]');
×
76

NEW
77
    expect(img).not.toBeNull();
×
78

NEW
79
    const imgNode = expectElement(img, 'Expected image element to be rendered');
×
NEW
80
    expect(imgNode.className).toBeTruthy();
×
NEW
81
    expect(imgNode.className).toMatch(/root/);
×
82
  });
83
});
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