Skip to content

Commit 7d41b13

Browse files
committed
Remove example history period tests in endpoint details
While updating, the "selecting history period updates graph values" tests were also simplified. There were previously six near-identical tests, one per history period (1m, 5m, 10m, 15m, 30m, 1h). Since the component uses a single watch on the history period store with no per-period branching logic, a single representative test is sufficient to cover this behaviour. The 1-minute test had also been silently broken: period 1 is the default, so navigating to the endpoint page and then "selecting" 1 minute was a no-op — the store value never changed, the watcher never fired, and no re-fetch occurred. The fix was a test issue only; the application correctly avoids re-fetching when the period hasn't changed.
1 parent e7b8569 commit 7d41b13

1 file changed

Lines changed: 1 addition & 85 deletions

File tree

src/Frontend/test/specs/monitoring/endpoint-details.spec.ts

Lines changed: 1 addition & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -40,74 +40,6 @@ describe("FEATURE: Endpoint details", () => {
4040
expect(await endpointDetailsGraphsAverageValues()).toEqual(["2", "1.97", "0", "74", "239"]);
4141
});
4242

43-
test(`EXAMPLE: Selecting 5 minute history period updates graph values`, async ({ driver }) => {
44-
//Arrange
45-
await driver.setUp(precondition.serviceControlWithMonitoring);
46-
const endpointDetails = structuredClone(monitoredEndpointDetails);
47-
await driver.setUp(precondition.hasMonitoredEndpointDetails(endpointDetails));
48-
await driver.goTo(`/monitoring/endpoint/Endpoint1`);
49-
await waitFor(async () => expect(await endpointDetailsGraphsCurrentValues()).toEqual(["2", "0", "0", "0", "0"]));
50-
51-
//Act
52-
await driver.setUp(precondition.hasEndpointWithMetricValues(2, 2, 8, 9.56, 13.24, 10, 81, 78, 215, 220));
53-
await selectHistoryPeriod(5);
54-
55-
//Assert
56-
expect(await endpointDetailsGraphsCurrentValues()).toEqual(["2", "8", "13.24", "81", "215"]);
57-
expect(await endpointDetailsGraphsAverageValues()).toEqual(["2", "9.56", "10", "78", "220"]);
58-
});
59-
60-
test(`EXAMPLE: Selecting 10 minute history period updates graph values`, async ({ driver }) => {
61-
//Arrange
62-
await driver.setUp(precondition.serviceControlWithMonitoring);
63-
const endpointDetails = structuredClone(monitoredEndpointDetails);
64-
await driver.setUp(precondition.hasMonitoredEndpointDetails(endpointDetails));
65-
await driver.goTo(`/monitoring/endpoint/Endpoint1`);
66-
await waitFor(async () => expect(await endpointDetailsGraphsCurrentValues()).toEqual(["2", "0", "0", "0", "0"]));
67-
68-
//Act
69-
await driver.setUp(precondition.hasEndpointWithMetricValues(5, 3.1, 12, 7.4, 2.2, 1, 124, 105.7, 201, 198));
70-
await selectHistoryPeriod(10);
71-
72-
//Assert
73-
expect(await endpointDetailsGraphsCurrentValues()).toEqual(["5", "12", "2.2", "124", "201"]);
74-
expect(await endpointDetailsGraphsAverageValues()).toEqual(["3.1", "7.4", "1", "105", "198"]);
75-
});
76-
77-
test(`EXAMPLE: Selecting 15 minute history period updates graph values`, async ({ driver }) => {
78-
//Arrange
79-
await driver.setUp(precondition.serviceControlWithMonitoring);
80-
const endpointDetails = structuredClone(monitoredEndpointDetails);
81-
await driver.setUp(precondition.hasMonitoredEndpointDetails(endpointDetails));
82-
await driver.goTo(`/monitoring/endpoint/Endpoint1`);
83-
await waitFor(async () => expect(await endpointDetailsGraphsCurrentValues()).toEqual(["2", "0", "0", "0", "0"]));
84-
85-
//Act
86-
await driver.setUp(precondition.hasEndpointWithMetricValues(8, 6.5, 15, 12.6, 3.1, 2.4, 278, 255.3, 403, 387.8));
87-
await selectHistoryPeriod(15);
88-
89-
//Assert
90-
expect(await endpointDetailsGraphsCurrentValues()).toEqual(["8", "15", "3.1", "278", "403"]);
91-
expect(await endpointDetailsGraphsAverageValues()).toEqual(["6.5", "12.6", "2.4", "255", "387"]);
92-
});
93-
94-
test(`EXAMPLE: Selecting 30 minute history period updates graph values`, async ({ driver }) => {
95-
//Arrange
96-
await driver.setUp(precondition.serviceControlWithMonitoring);
97-
const endpointDetails = structuredClone(monitoredEndpointDetails);
98-
await driver.setUp(precondition.hasMonitoredEndpointDetails(endpointDetails));
99-
await driver.goTo(`/monitoring/endpoint/Endpoint1`);
100-
await waitFor(async () => expect(await endpointDetailsGraphsCurrentValues()).toEqual(["2", "0", "0", "0", "0"]));
101-
102-
//Act
103-
await driver.setUp(precondition.hasEndpointWithMetricValues(1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 777.7, 888.8, 999.9, 800.8));
104-
await selectHistoryPeriod(30);
105-
106-
//Assert
107-
expect(await endpointDetailsGraphsCurrentValues()).toEqual(["1.1", "3.3", "5.5", "777", "999"]);
108-
expect(await endpointDetailsGraphsAverageValues()).toEqual(["2.2", "4.4", "6.6", "888", "800"]);
109-
});
110-
11143
test(`EXAMPLE: Selecting 60 minute history period updates graph values`, async ({ driver }) => {
11244
//Arrange
11345
await driver.setUp(precondition.serviceControlWithMonitoring);
@@ -124,24 +56,8 @@ describe("FEATURE: Endpoint details", () => {
12456
expect(await endpointDetailsGraphsCurrentValues()).toEqual(["10", "7.78", "5.55", "333", "111"]);
12557
expect(await endpointDetailsGraphsAverageValues()).toEqual(["8.89", "6.67", "4.44", "222", "100"]);
12658
});
127-
128-
test(`EXAMPLE: Selecting 1 minute history period updates graph values`, async ({ driver }) => {
129-
//Arrange
130-
await driver.setUp(precondition.serviceControlWithMonitoring);
131-
const endpointDetails = structuredClone(monitoredEndpointDetails);
132-
await driver.setUp(precondition.hasMonitoredEndpointDetails(endpointDetails));
133-
await driver.goTo(`/monitoring/endpoint/Endpoint1`);
134-
await waitFor(async () => expect(await endpointDetailsGraphsCurrentValues()).toEqual(["2", "0", "0", "0", "0"]));
135-
136-
//Act
137-
await driver.setUp(precondition.hasEndpointWithMetricValues(1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
138-
await selectHistoryPeriod(1);
139-
140-
//Assert
141-
expect(await endpointDetailsGraphsCurrentValues()).toEqual(["1", "3", "5", "7", "9"]);
142-
expect(await endpointDetailsGraphsAverageValues()).toEqual(["2", "4", "6", "8", "10"]);
143-
});
14459
});
60+
14561
describe("RULE: Endpoint detail metric data should be updated at the interval selected by the history period", () => {
14662
[
14763
{ description: "As history period is changed to 5 minutes the endpoint metrics data should be updated at the correct interval", historyPeriod: 5 },

0 commit comments

Comments
 (0)