@centreon/ui 24.4.1-MON-34691-improve-code-coverage.9 → 24.4.1-MON-34691-improve-code-coverage.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@centreon/ui",
3
- "version": "24.4.1-MON-34691-improve-code-coverage.9",
3
+ "version": "24.4.1-MON-34691-improve-code-coverage.10",
4
4
  "description": "Centreon UI Components",
5
5
  "scripts": {
6
6
  "eslint": "eslint ./src --ext .js,.jsx,.ts,.tsx --max-warnings 0",
@@ -29,6 +29,12 @@ const initialize = (
29
29
  };
30
30
 
31
31
  describe('Gauge', () => {
32
+ it('does not display the gauge when there is no data', () => {
33
+ initialize({ data: undefined, thresholds: successThresholds });
34
+
35
+ cy.contains('0.41 s').should('not.exist');
36
+ });
37
+
32
38
  it('displays the gauge as success when corresponding thresholds are set', () => {
33
39
  initialize({ thresholds: successThresholds });
34
40
 
@@ -137,4 +137,9 @@ describe('HeatMap', () => {
137
137
 
138
138
  cy.makeSnapshot();
139
139
  });
140
+
141
+ it('displays a single tile', () => {
142
+ initialize({ tiles: [heatMapData[0]] });
143
+ cy.findByTestId(dataIds[0]).should('be.visible');
144
+ });
140
145
  });
@@ -75,4 +75,27 @@ describe('Text', () => {
75
75
 
76
76
  cy.makeSnapshot();
77
77
  });
78
+
79
+ it('does not display the text', () => {
80
+ initialize({ data: undefined, thresholds: successThresholds });
81
+
82
+ cy.contains('0.41 s').should('not.exist');
83
+
84
+ cy.makeSnapshot();
85
+ });
86
+
87
+ it('displays text with default values when the data is empty', () => {
88
+ initialize({
89
+ data: {
90
+ global: {},
91
+ metrics: [],
92
+ times: []
93
+ },
94
+ thresholds: successThresholds
95
+ });
96
+
97
+ cy.contains('0').should('be.visible');
98
+
99
+ cy.makeSnapshot();
100
+ });
78
101
  });