summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordanielhanrahan <daniel.hanrahan@est.tech>2022-01-31 12:05:36 +0000
committerDaniel Hanrahan <daniel.hanrahan@est.tech>2022-01-31 12:20:19 +0000
commitc0a3e2fd655ca42dd3291e2b6f0346e4e44ffc87 (patch)
tree600073b3c23495b4feb01dce708221b806d3e44e
parent9957cf988f2199d9d0ff3838e7f90e70d9cb6ae8 (diff)
Fix assertions in ControlLoopService test
Fix assertion lines to check response status value. Wrap responses in beforeEach so async calls are resolved before assertions. Issue-ID: POLICY-3351 Signed-off-by: danielhanrahan <daniel.hanrahan@est.tech> Change-Id: If540831367a7e359739b9675a2800b426b3e7f20
-rw-r--r--gui-clamp/ui-react/src/api/ControlLoopService.test.js12
1 files changed, 8 insertions, 4 deletions
diff --git a/gui-clamp/ui-react/src/api/ControlLoopService.test.js b/gui-clamp/ui-react/src/api/ControlLoopService.test.js
index a460225..47fef71 100644
--- a/gui-clamp/ui-react/src/api/ControlLoopService.test.js
+++ b/gui-clamp/ui-react/src/api/ControlLoopService.test.js
@@ -28,9 +28,11 @@ describe("Verify GetControlLoopInstantiation", () => {
ok: true,
})
);
- response = ControlLoopService.getControlLoopInstantiation(name, template);
+ beforeEach(async () => {
+ response = await ControlLoopService.getControlLoopInstantiation(name, template);
+ });
it("Test getControlLoopInstantiation", () => {
- expect(response.status).toEqual(response.status);
+ expect(response.status).toEqual("Success");
});
});
describe("Verify DeleteInstantiation", () => {
@@ -43,8 +45,10 @@ describe("Verify DeleteInstantiation", () => {
ok: true,
})
);
- response = ControlLoopService.deleteInstantiation(name, version);
+ beforeEach(async () => {
+ response = await ControlLoopService.deleteInstantiation(name, version);
+ });
it("Test deleteInstantiation", () => {
- expect(response.status).toEqual(response.status);
+ expect(response.status).toEqual("Success");
});
});