• 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/PaginatedTable/Customize/DataAvailability/HeaderCell.generated.test.jsx
1
// /Users/ranaab/Documents/repository/workspace/bento-icdc-frontend/src/components/PaginatedTable/Customize/DataAvailability/HeaderCell.generated.test.jsx
2
import React from 'react';
3
import { render, screen } from '@testing-library/react';
4
import DataAvailabilityHeader from './HeaderCell.jsx';
5

NEW
6
describe('DataAvailabilityHeader', () => {
×
NEW
7
  it('should render an img with provided src and alt (happy path)', () => {
×
8
    // Arrange
NEW
9
    const icon = 'mock-flag.png';
×
NEW
10
    const dataField = 'US Flag';
×
11

12
    // Act
NEW
13
    render(<DataAvailabilityHeader icon={icon} dataField={dataField} />);
×
14

15
    // Assert
NEW
16
    const img = screen.getByAltText(dataField);
×
NEW
17
    expect(img).toBeTruthy();
×
18

19
    // jsdom may turn relative srcs into absolute; use contains for determinism
NEW
20
    expect(img.getAttribute('src')).toContain(icon);
×
21

22
    // withStyles should inject a class
NEW
23
    expect(img.className).toBeTruthy();
×
24
  });
25

NEW
26
  it('should render img with empty alt when dataField is an empty string (edge case)', () => {
×
27
    // Arrange
NEW
28
    const icon = 'mock-flag.png';
×
NEW
29
    const dataField = '';
×
30

31
    // Act
NEW
32
    render(<DataAvailabilityHeader icon={icon} dataField={dataField} />);
×
33

34
    // Assert
NEW
35
    const img = screen.getByAltText(dataField); // empty string
×
NEW
36
    expect(img).toBeTruthy();
×
NEW
37
    expect(img.getAttribute('src')).toContain(icon);
×
38
  });
39

NEW
40
  it('should render img without alt attribute when dataField is undefined (null/undefined case)', () => {
×
41
    // Arrange
NEW
42
    const icon = 'mock-flag.png';
×
43

44
    // Act
NEW
45
    const { container } = render(<DataAvailabilityHeader icon={icon} />);
×
46

47
    // Assert
NEW
48
    const img = container.querySelector('img');
×
NEW
49
    expect(img).toBeTruthy();
×
50
    // alt is not set when undefined
NEW
51
    expect(img.hasAttribute('alt')).toBe(false);
×
NEW
52
    expect(img.getAttribute('src')).toContain(icon);
×
53
  });
54

NEW
55
  it('should render img without src attribute when icon is undefined (invalid input)', () => {
×
56
    // Arrange
NEW
57
    const dataField = 'No Icon';
×
58

59
    // Act
NEW
60
    const { container } = render(
×
61
      <DataAvailabilityHeader dataField={dataField} />
62
    );
63

64
    // Assert
NEW
65
    const img = container.querySelector('img');
×
NEW
66
    expect(img).toBeTruthy();
×
67
    // React omits attribute when value is undefined
NEW
68
    expect(img.hasAttribute('src')).toBe(false);
×
69
    // alt should be present with provided dataField
NEW
70
    expect(img.getAttribute('alt')).toBe(dataField);
×
71
  });
72

NEW
73
  it('should render even when both icon and dataField are undefined (robustness)', () => {
×
74
    // Act
NEW
75
    const { container } = render(<DataAvailabilityHeader />);
×
76

77
    // Assert
NEW
78
    const img = container.querySelector('img');
×
NEW
79
    expect(img).toBeTruthy();
×
80
    // Both attributes omitted when undefined
NEW
81
    expect(img.hasAttribute('src')).toBe(false);
×
NEW
82
    expect(img.hasAttribute('alt')).toBe(false);
×
83
    // withStyles should still inject a non-empty class
NEW
84
    expect(img.className).toBeTruthy();
×
85
  });
86
});
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