Skip to content

Commit 7bb7719

Browse files
committed
change post coo140 and lint enabled on cypress files
1 parent 969bc1f commit 7bb7719

File tree

128 files changed

+10274
-6615
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

128 files changed

+10274
-6615
lines changed

web/cypress/dummy.tsx

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,21 @@ export {
1414
YellowExclamationTriangleIcon,
1515
} from '@openshift-console/dynamic-plugin-sdk';
1616

17-
export const consoleFetchJSON = (url) => fetch(url)
18-
.then(response => response.json());
19-
consoleFetchJSON.delete = (url) => fetch(url, { method: 'DELETE' })
20-
.then(response => response.json());
21-
consoleFetchJSON.post = (url, json) => fetch(url, { body: JSON.stringify(json), method: 'POST'})
22-
.then(response => response.json());
17+
export const consoleFetchJSON = (url) => fetch(url).then((response) => response.json());
18+
consoleFetchJSON.delete = (url) =>
19+
fetch(url, { method: 'DELETE' }).then((response) => response.json());
20+
consoleFetchJSON.post = (url, json) =>
21+
fetch(url, { body: JSON.stringify(json), method: 'POST' }).then((response) => response.json());
2322

2423
export const ListPageFilter = () => <input data-test="name-filter-input"></input>;
2524

2625
export const VirtualizedTable = ({ data, Row }) => (
2726
<table>
2827
<tbody>
2928
<tr data-test-rows="resource-row">
30-
{data.map((obj, i) => <Row key={i} obj={obj} />)}
29+
{data.map((obj, i) => (
30+
<Row key={i} obj={obj} />
31+
))}
3132
</tr>
3233
</tbody>
3334
</table>
@@ -36,4 +37,5 @@ export const VirtualizedTable = ({ data, Row }) => (
3637
export const Timestamp = () => <div>Mock_Timestamp</div>;
3738

3839
export const useActivePerspective = () => ['admin'];
39-
export const useListPageFilter = (data, rowFilters) => [data, data, () => {}];
40+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
41+
export const useListPageFilter = (data, _rowFilters) => [data, data, () => {}];

web/cypress/e2e/coo/01.coo_bvt.cy.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { commonPages } from '../../views/common';
22
import { nav } from '../../views/nav';
33
import { troubleshootingPanelPage } from '../../views/troubleshooting-panel';
44

5-
65
// Set constants for the operators that need to be installed for tests.
76
const MCP = {
87
namespace: Cypress.env('COO_NAMESPACE'),
@@ -20,10 +19,8 @@ const MP = {
2019
};
2120

2221
describe('BVT: COO', { tags: ['@smoke', '@coo'] }, () => {
23-
2422
before(() => {
2523
cy.beforeBlockCOO(MCP, MP);
26-
2724
});
2825

2926
it('1. Admin perspective - Observe Menu', () => {
@@ -40,11 +37,9 @@ describe('BVT: COO', { tags: ['@smoke', '@coo'] }, () => {
4037
nav.sidenav.clickNavLink(['Observe', 'Alerting']);
4138
troubleshootingPanelPage.openSignalCorrelation();
4239
troubleshootingPanelPage.troubleshootingPanelPageShouldBeLoadedEnabled();
43-
4440
});
4541

4642
/**
4743
* TODO: To be replaced by COO validation such as Dashboards (Perses) scenarios
4844
*/
49-
5045
});

web/cypress/e2e/coo/01.coo_ivt.cy.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,10 @@ const KBV = {
1313
crd: {
1414
kubevirt: 'kubevirts.kubevirt.io',
1515
hyperconverged: 'hyperconvergeds.hco.kubevirt.io',
16-
}
16+
},
1717
};
1818

1919
describe('IVT: Monitoring UIPlugin + Virtualization', { tags: ['@smoke', '@coo'] }, () => {
20-
2120
before(() => {
2221
cy.beforeBlockVirtualization(KBV);
2322
});
@@ -28,11 +27,9 @@ describe('IVT: Monitoring UIPlugin + Virtualization', { tags: ['@smoke', '@coo']
2827
guidedTour.closeKubevirtTour();
2928
troubleshootingPanelPage.signalCorrelationShouldNotBeVisible();
3029
cy.switchPerspective('Core platform', 'Administrator');
31-
3230
});
3331

3432
/**
3533
* TODO: To be replaced by COO validation such as Dashboards (Perses) scenarios
3634
*/
37-
3835
});

web/cypress/e2e/coo/02.acm_alerting_ui.cy.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ describe('ACM Alerting UI', { tags: ['@coo', '@alerts'] }, () => {
2929
// check monitoring-plugin UI is not been affected
3030
cy.switchPerspective('Core platform');
3131
nav.sidenav.clickNavLink(['Observe', 'Alerting']);
32-
commonPages.titleShouldHaveText('Alerting')
32+
commonPages.titleShouldHaveText('Alerting');
3333
nav.sidenav.clickNavLink(['Observe', 'Metrics']);
3434
commonPages.titleShouldHaveText('Metrics');
3535
// switch to Fleet Management page
@@ -50,8 +50,9 @@ describe('ACM Alerting UI', { tags: ['@coo', '@alerts'] }, () => {
5050
acmAlertingPage.shouldBeLoaded();
5151
// check test alerts exist
5252
expectedAlerts.forEach((alert) => {
53-
cy.contains('a[data-test-id="alert-resource-link"]', alert, { timeout: 120000 })
54-
.should('be.visible');
53+
cy.contains('a[data-test-id="alert-resource-link"]', alert, { timeout: 120000 }).should(
54+
'be.visible',
55+
);
5556
});
5657
cy.log('Verified all expected alerts are visible on the Alerting page');
5758
cy.log('ACM Alerting UI test completed successfully');

web/cypress/e2e/incidents/00.coo_incidents_e2e.cy.ts

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
The test verifies the whole lifecycle of the Incident feature, without any external dependencies.
33
The run time can be 15 - 20 minutes. (Waiting untill the incident detection captures the new alert)
44
*/
5-
import { commonPages } from '../../views/common';
65
import { incidentsPage } from '../../views/incidents-page';
76

87
// Set constants for the operators that need to be installed for tests.
@@ -26,8 +25,8 @@ describe('BVT: Incidents - e2e', { tags: ['@smoke', '@slow', '@incidents', '@e2e
2625

2726
before(() => {
2827
cy.beforeBlockCOO(MCP, MP, { dashboards: false, troubleshootingPanel: false });
29-
30-
cy.cleanupIncidentPrometheusRules();
28+
29+
cy.cleanupIncidentPrometheusRules();
3130

3231
// Create the alert and capture the random name
3332
cy.createKubePodCrashLoopingAlert().then((alertName) => {
@@ -41,24 +40,17 @@ describe('BVT: Incidents - e2e', { tags: ['@smoke', '@slow', '@incidents', '@e2e
4140
cy.log('1.1 Navigate to Incidents page and clear filters');
4241
incidentsPage.goTo();
4342
incidentsPage.clearAllFilters();
44-
43+
4544
const intervalMs = 60_000;
46-
const maxMinutes = 30;
45+
const maxMinutes = 30;
4746

4847
cy.log('1.2 Wait for incident with custom alert to appear');
49-
cy.waitUntil(
50-
() => incidentsPage.findIncidentWithAlert(currentAlertName),
51-
{
52-
interval: intervalMs,
53-
timeout: maxMinutes * intervalMs,
54-
}
55-
);
48+
cy.waitUntil(() => incidentsPage.findIncidentWithAlert(currentAlertName), {
49+
interval: intervalMs,
50+
timeout: maxMinutes * intervalMs,
51+
});
5652

5753
cy.log('1.3 Verify custom alert appears in alerts table');
58-
incidentsPage
59-
.elements
60-
.incidentsTable()
61-
.contains(currentAlertName)
62-
.should('exist');
54+
incidentsPage.elements.incidentsTable().contains(currentAlertName).should('exist');
6355
});
64-
});
56+
});

web/cypress/e2e/incidents/01.incidents.cy.ts

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,17 @@ const MP = {
2727
describe('BVT: Incidents - UI', { tags: ['@smoke', '@incidents'] }, () => {
2828
before(() => {
2929
cy.beforeBlockCOO(MCP, MP, { dashboards: false, troubleshootingPanel: false });
30-
cy.mockIncidentFixture('incident-scenarios/1-single-incident-firing-critical-and-warning-alerts.yaml');
30+
cy.mockIncidentFixture(
31+
'incident-scenarios/1-single-incident-firing-critical-and-warning-alerts.yaml',
32+
);
3133
});
3234

33-
3435
it('1. Admin perspective - Incidents page - Toolbar and charts toggle functionality', () => {
3536
cy.log('1.1 Verify toolbar and toggle charts button');
3637
incidentsPage.elements.toolbar().should('be.visible');
3738
incidentsPage.elements.toggleChartsButton().should('be.visible');
3839
incidentsPage.elements.toggleChartsButton().click();
39-
40+
4041
cy.log('1.2 Verify charts are hidden after toggle');
4142
incidentsPage.elements.incidentsChartTitle().should('not.exist');
4243
incidentsPage.elements.alertsChartTitle().should('not.exist');
@@ -46,7 +47,7 @@ describe('BVT: Incidents - UI', { tags: ['@smoke', '@incidents'] }, () => {
4647
it('2. Admin perspective - Incidents page - Days filter functionality', () => {
4748
cy.log('2.1 Set days filter to 3 days');
4849
incidentsPage.setDays('3 days');
49-
50+
5051
cy.log('2.2 Verify filter selection is updated');
5152
incidentsPage.elements.daysSelectToggle().should('contain.text', '3 days');
5253
});
@@ -55,18 +56,19 @@ describe('BVT: Incidents - UI', { tags: ['@smoke', '@incidents'] }, () => {
5556
cy.log('3.1 Clear filters and toggle Critical filter');
5657
incidentsPage.clearAllFilters();
5758
incidentsPage.toggleFilter('Critical');
58-
// Visibility verification of the filter chip is too complex. The functionality will be
59+
// Visibility verification of the filter chip is too complex. The functionality will be
5960
// better verified in the filtering specific test.
6061
cy.log('3.2 Verify filter can be removed');
6162
incidentsPage.removeFilter('Severity', 'Critical');
6263
});
6364

6465
it('4. Admin perspective - Incidents page - Charts and alerts empty state', () => {
6566
cy.mockIncidents([]);
66-
67+
6768
cy.log('4.1 Verify chart titles are visible');
6869
incidentsPage.elements.incidentsChartTitle().should('be.visible');
6970
incidentsPage.elements.alertsChartTitle().should('be.visible');
71+
7072
cy.log('4.2 Verify alerts chart shows empty state');
7173
incidentsPage.elements.alertsChartEmptyState().should('exist');
7274
});
@@ -79,11 +81,13 @@ describe('BVT: Incidents - UI', { tags: ['@smoke', '@incidents'] }, () => {
7981
incidentsPage.findIncidentWithAlert('TargetAlert').should('be.false');
8082

8183
cy.log('5.2 Verify traversing incident table works when the alert is not present');
82-
cy.mockIncidentFixture('incident-scenarios/1-single-incident-firing-critical-and-warning-alerts.yaml');
84+
cy.mockIncidentFixture(
85+
'incident-scenarios/1-single-incident-firing-critical-and-warning-alerts.yaml',
86+
);
8387
incidentsPage.findIncidentWithAlert('TargetAlert').should('be.false');
8488

8589
cy.log('5.3 Verify traversing incident table works when the alert is present');
8690
cy.mockIncidentFixture('incident-scenarios/6-multi-incident-target-alert-scenario.yaml');
8791
incidentsPage.findIncidentWithAlert('TargetAlert').should('be.true');
8892
});
89-
});
93+
});

web/cypress/e2e/incidents/02.incidents-mocking-example.cy.ts

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ This test showcases different mocking approaches:
77
3. Demonstrating empty state handling
88
*/
99

10-
import { commonPages } from '../../views/common';
1110
import { incidentsPage } from '../../views/incidents-page';
12-
import { IncidentDefinition } from '../../support/incidents_prometheus_query_mocks';
1311

1412
const MCP = {
1513
namespace: Cypress.env('COO_NAMESPACE'),
@@ -27,7 +25,6 @@ const MP = {
2725
};
2826

2927
describe('Incidents - Mocking Examples', { tags: ['@demo', '@incidents'] }, () => {
30-
3128
before(() => {
3229
cy.beforeBlockCOO(MCP, MP, { dashboards: false, troubleshootingPanel: false });
3330
});
@@ -40,37 +37,43 @@ describe('Incidents - Mocking Examples', { tags: ['@demo', '@incidents'] }, () =
4037
it('1. Mock silenced and firing incidents with mixed severity', () => {
4138
cy.log('Setting up silenced critical and firing warning incidents');
4239
cy.mockIncidentFixture('incident-scenarios/silenced-and-firing-mixed-severity.yaml');
43-
44-
cy.log('One silenced critical incident (resolved) and one firing warning incident should be visible');
40+
41+
cy.log(
42+
'One silenced critical incident (resolved) and one firing warning incident should be visible',
43+
);
4544
cy.pause();
4645
});
4746

4847
it('2. Mock healthy cluster from fixture', () => {
4948
cy.log('Setting up healthy cluster scenario from fixture');
5049
cy.mockIncidentFixture('incident-scenarios/0-healthy-cluster.yaml');
51-
50+
5251
cy.pause();
5352
});
5453

5554
it('3. Mock single incident with critical and warning alerts', () => {
5655
cy.log('Setting up single incident with critical and warning alerts from fixture');
57-
cy.mockIncidentFixture('incident-scenarios/1-single-incident-firing-critical-and-warning-alerts.yaml');
56+
cy.mockIncidentFixture(
57+
'incident-scenarios/1-single-incident-firing-critical-and-warning-alerts.yaml',
58+
);
5859
cy.log('Single incident with mixed severity alerts should be visible');
5960
cy.pause();
6061
});
6162

6263
it('4. Mock multi-incidents with resolved and firing alerts', () => {
6364
cy.log('Setting up multi-incidents with resolved and firing alerts from fixture');
64-
cy.mockIncidentFixture('incident-scenarios/2-multi-incidents-multi-alerts-resolved-and-firing.yaml');
65-
65+
cy.mockIncidentFixture(
66+
'incident-scenarios/2-multi-incidents-multi-alerts-resolved-and-firing.yaml',
67+
);
68+
6669
cy.log('Multiple incidents with mixed alert states should be visible');
6770
cy.pause();
6871
});
6972

7073
it('5. Mock multi-severity overlapping incidents', () => {
7174
cy.log('Setting up multi-severity overlapping incidents from fixture');
7275
cy.mockIncidentFixture('incident-scenarios/3-multi-severity-overlapping-incidents.yaml');
73-
76+
7477
cy.log('Overlapping incidents with different severity distributions should be visible');
7578
cy.pause();
7679
});
@@ -81,15 +84,13 @@ describe('Incidents - Mocking Examples', { tags: ['@demo', '@incidents'] }, () =
8184

8285
cy.log('Single incident with escalating severity alerts should be visible');
8386
cy.pause();
84-
8587
});
8688

8789
it('7. Mock empty incident state', () => {
8890
cy.log('Setting up empty incident state');
8991
cy.mockIncidents([]);
90-
92+
9193
cy.log('No incidents should be visible - empty state');
9294
cy.pause();
9395
});
94-
95-
});
96+
});

0 commit comments

Comments
 (0)