Skip to content

Commit 1d62fbe

Browse files
committed
add driver set up for servicecontrolwithmonitoring to fix the tests
1 parent 56aef1b commit 1d62fbe

File tree

4 files changed

+35
-39
lines changed

4 files changed

+35
-39
lines changed

src/Frontend/test/preconditions/hasCustomChecksFailing.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export const hasCustomChecksFailing = ({ driver }: SetupFactoryOptions) => {
1515
originating_endpoint: {
1616
name: "Particular.ServiceControl.Audit",
1717
host_id: "ff605b55-6fbb-af56-5753-73c1ff73e601",
18-
host: "COMPUSA-LAPTOP",
18+
host: "COMPUSA",
1919
},
2020
},
2121
{
@@ -28,7 +28,7 @@ export const hasCustomChecksFailing = ({ driver }: SetupFactoryOptions) => {
2828
originating_endpoint: {
2929
name: "Particular.ServiceControl",
3030
host_id: "9f822d11-b097-a4df-3db5-e069e5d356fe",
31-
host: "COMPUSA-LAPTOP",
31+
host: "COMPUSA",
3232
},
3333
},
3434
{
@@ -41,7 +41,7 @@ export const hasCustomChecksFailing = ({ driver }: SetupFactoryOptions) => {
4141
originating_endpoint: {
4242
name: "Particular.ServiceControl",
4343
host_id: "9f822d11-b097-a4df-3db5-e069e5d356fe",
44-
host: "COMPUSA-LAPTOP",
44+
host: "COMPUSA",
4545
},
4646
},
4747
{
@@ -54,7 +54,7 @@ export const hasCustomChecksFailing = ({ driver }: SetupFactoryOptions) => {
5454
originating_endpoint: {
5555
name: "Particular.ServiceControl",
5656
host_id: "9f822d11-b097-a4df-3db5-e069e5d356fe",
57-
host: "COMPUSA-LAPTOP",
57+
host: "COMPUSA",
5858
},
5959
},
6060
{
@@ -67,7 +67,7 @@ export const hasCustomChecksFailing = ({ driver }: SetupFactoryOptions) => {
6767
originating_endpoint: {
6868
name: "Particular.ServiceControl",
6969
host_id: "9f822d11-b097-a4df-3db5-e069e5d356fe",
70-
host: "COMPUSA-LAPTOP",
70+
host: "COMPUSA",
7171
},
7272
},
7373
{
@@ -80,7 +80,7 @@ export const hasCustomChecksFailing = ({ driver }: SetupFactoryOptions) => {
8080
originating_endpoint: {
8181
name: "Particular.ServiceControl",
8282
host_id: "9f822d11-b097-a4df-3db5-e069e5d356fe",
83-
host: "COMPUSA-LAPTOP",
83+
host: "COMPUSA",
8484
},
8585
},
8686
{
@@ -93,7 +93,7 @@ export const hasCustomChecksFailing = ({ driver }: SetupFactoryOptions) => {
9393
originating_endpoint: {
9494
name: "Particular.ServiceControl",
9595
host_id: "9f822d11-b097-a4df-3db5-e069e5d356fe",
96-
host: "COMPUSA-LAPTOP",
96+
host: "COMPUSA",
9797
},
9898
},
9999
{
@@ -106,7 +106,7 @@ export const hasCustomChecksFailing = ({ driver }: SetupFactoryOptions) => {
106106
originating_endpoint: {
107107
name: "Particular.ServiceControl.Audit",
108108
host_id: "ff605b55-6fbb-af56-5753-73c1ff73e601",
109-
host: "COMPUSA-LAPTOP",
109+
host: "COMPUSA",
110110
},
111111
},
112112
],

src/Frontend/test/preconditions/hasCustomChecksPassing.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export const hasCustomChecksPassing = ({ driver }: SetupFactoryOptions) => {
1414
originating_endpoint: {
1515
name: "Particular.ServiceControl.Audit",
1616
host_id: "ff605b55-6fbb-af56-5753-73c1ff73e601",
17-
host: "COMPUSA-LAPTOP",
17+
host: "COMPUSA",
1818
},
1919
},
2020
{
@@ -26,7 +26,7 @@ export const hasCustomChecksPassing = ({ driver }: SetupFactoryOptions) => {
2626
originating_endpoint: {
2727
name: "Particular.ServiceControl",
2828
host_id: "9f822d11-b097-a4df-3db5-e069e5d356fe",
29-
host: "COMPUSA-LAPTOP",
29+
host: "COMPUSA",
3030
},
3131
},
3232
{
@@ -38,7 +38,7 @@ export const hasCustomChecksPassing = ({ driver }: SetupFactoryOptions) => {
3838
originating_endpoint: {
3939
name: "Particular.ServiceControl.Audit",
4040
host_id: "ff605b55-6fbb-af56-5753-73c1ff73e601",
41-
host: "COMPUSA-LAPTOP",
41+
host: "COMPUSA",
4242
},
4343
},
4444
{
@@ -50,7 +50,7 @@ export const hasCustomChecksPassing = ({ driver }: SetupFactoryOptions) => {
5050
originating_endpoint: {
5151
name: "Particular.ServiceControl.Audit",
5252
host_id: "ff605b55-6fbb-af56-5753-73c1ff73e601",
53-
host: "COMPUSA-LAPTOP",
53+
host: "COMPUSA",
5454
},
5555
},
5656
{
@@ -62,7 +62,7 @@ export const hasCustomChecksPassing = ({ driver }: SetupFactoryOptions) => {
6262
originating_endpoint: {
6363
name: "Particular.ServiceControl",
6464
host_id: "9f822d11-b097-a4df-3db5-e069e5d356fe",
65-
host: "COMPUSA-LAPTOP",
65+
host: "COMPUSA",
6666
},
6767
},
6868
{
@@ -74,7 +74,7 @@ export const hasCustomChecksPassing = ({ driver }: SetupFactoryOptions) => {
7474
originating_endpoint: {
7575
name: "Particular.ServiceControl",
7676
host_id: "9f822d11-b097-a4df-3db5-e069e5d356fe",
77-
host: "COMPUSA-LAPTOP",
77+
host: "COMPUSA",
7878
},
7979
},
8080
{
@@ -86,7 +86,7 @@ export const hasCustomChecksPassing = ({ driver }: SetupFactoryOptions) => {
8686
originating_endpoint: {
8787
name: "Particular.ServiceControl",
8888
host_id: "9f822d11-b097-a4df-3db5-e069e5d356fe",
89-
host: "COMPUSA-LAPTOP",
89+
host: "COMPUSA",
9090
},
9191
},
9292
{
@@ -98,7 +98,7 @@ export const hasCustomChecksPassing = ({ driver }: SetupFactoryOptions) => {
9898
originating_endpoint: {
9999
name: "Particular.ServiceControl",
100100
host_id: "9f822d11-b097-a4df-3db5-e069e5d356fe",
101-
host: "COMPUSA-LAPTOP",
101+
host: "COMPUSA",
102102
},
103103
},
104104
{
@@ -110,7 +110,7 @@ export const hasCustomChecksPassing = ({ driver }: SetupFactoryOptions) => {
110110
originating_endpoint: {
111111
name: "Particular.ServiceControl",
112112
host_id: "9f822d11-b097-a4df-3db5-e069e5d356fe",
113-
host: "COMPUSA-LAPTOP",
113+
host: "COMPUSA",
114114
},
115115
},
116116
{
@@ -122,7 +122,7 @@ export const hasCustomChecksPassing = ({ driver }: SetupFactoryOptions) => {
122122
originating_endpoint: {
123123
name: "Particular.ServiceControl",
124124
host_id: "9f822d11-b097-a4df-3db5-e069e5d356fe",
125-
host: "COMPUSA-LAPTOP",
125+
host: "COMPUSA",
126126
},
127127
},
128128
{
@@ -134,7 +134,7 @@ export const hasCustomChecksPassing = ({ driver }: SetupFactoryOptions) => {
134134
originating_endpoint: {
135135
name: "Particular.ServiceControl",
136136
host_id: "9f822d11-b097-a4df-3db5-e069e5d356fe",
137-
host: "COMPUSA-LAPTOP",
137+
host: "COMPUSA",
138138
},
139139
},
140140
{
@@ -146,7 +146,7 @@ export const hasCustomChecksPassing = ({ driver }: SetupFactoryOptions) => {
146146
originating_endpoint: {
147147
name: "Particular.ServiceControl",
148148
host_id: "9f822d11-b097-a4df-3db5-e069e5d356fe",
149-
host: "COMPUSA-LAPTOP",
149+
host: "COMPUSA",
150150
},
151151
},
152152
{
@@ -158,7 +158,7 @@ export const hasCustomChecksPassing = ({ driver }: SetupFactoryOptions) => {
158158
originating_endpoint: {
159159
name: "Particular.ServiceControl.Audit",
160160
host_id: "ff605b55-6fbb-af56-5753-73c1ff73e601",
161-
host: "COMPUSA-LAPTOP",
161+
host: "COMPUSA",
162162
},
163163
},
164164
],

src/Frontend/test/specs/customchecks/questions/customChecksMessage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ import { screen } from "@testing-library/vue";
22

33
export async function customChecksMessage() {
44
const txtMessage = await screen.findByRole("heading", { name: "customcheck-message" });
5-
return txtMessage.innerHTML;
5+
return txtMessage.textContent?.trim();
66
}

src/Frontend/test/specs/customchecks/viewing-no-data.spec.ts

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,46 +3,42 @@ import { expect } from "vitest";
33
import * as precondition from "../../preconditions";
44
import { customChecksMessage } from "./questions/customChecksMessage";
55
import { waitFor } from "@testing-library/vue";
6-
// import NoData from "../../../src/components/NoData.vue";
7-
// import { screen } from "@testing-library/vue";
8-
// import { render } from "@component-test-utils";
6+
97
describe("FEATURE: No data", () => {
10-
/* SCENARIO
8+
describe("RULE: When there is no data to show a message should be displayed ", () => {
9+
/* SCENARIO
1110
Given there are no custom checks
1211
When navigating to the custom checks tab
1312
Then a message is shown "No failed custom checks"
1413
*/
15-
describe("RULE: When there is no data to show a message should be displayed ", () => {
1614
test("EXAMPLE: 'No failed custom checks' should be displayed when there are no custom checks", async ({ driver }) => {
1715
//Arrange
16+
await driver.setUp(precondition.serviceControlWithMonitoring);
17+
// given that the custom check list is empty
1818
await driver.setUp(precondition.hasCustomChecksEmpty);
19-
//Act
19+
20+
//Act - When navigating to the custom checks tab
2021
await driver.goTo("/custom-checks");
2122
//Expect
22-
//render(NoData, { props: { message: "No failed custom checks" } });
23-
//expect(await screen.findByText("No failed custom checks")).toBeVisible();
24-
// expect(await customChecksMessage()).toBe("No failed custom checks");
2523
await waitFor(async () => {
2624
expect(await customChecksMessage()).toBe("No failed custom checks");
2725
});
2826
});
29-
});
30-
/* SCENARIO
27+
/* SCENARIO
3128
Given there are custom checks
3229
And all custom checks are in a success state
3330
When navigating to the custom checks tab
34-
The a message is shown "No failed custom checks"
31+
Then a message is shown "No failed custom checks"
3532
*/
36-
describe("RULE: When there is no data to show a message should be displayed ", () => {
3733
test("EXAMPLE: 'No failed custom checks' should be displayed when all custom checks are in a success state", async ({ driver }) => {
3834
//Arrange
35+
await driver.setUp(precondition.serviceControlWithMonitoring);
36+
// given that the custom check list is not empty and status of all checks are passing
3937
await driver.setUp(precondition.hasCustomChecksPassing);
40-
//Act
38+
39+
//Act - When navigating to the custom checks tab
4140
await driver.goTo("/custom-checks");
4241
//Expect
43-
//render(NoData, { props: { message: "No failed custom checks" } });
44-
// expect(await screen.findByText("No failed custom checks")).toBeVisible();
45-
//expect(await customChecksMessage()).toBe("No failed custom checks");
4642
await waitFor(async () => {
4743
expect(await customChecksMessage()).toBe("No failed custom checks");
4844
});

0 commit comments

Comments
 (0)