From c0a3e2fd655ca42dd3291e2b6f0346e4e44ffc87 Mon Sep 17 00:00:00 2001 From: danielhanrahan Date: Mon, 31 Jan 2022 12:05:36 +0000 Subject: 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 Change-Id: If540831367a7e359739b9675a2800b426b3e7f20 --- gui-clamp/ui-react/src/api/ControlLoopService.test.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'gui-clamp/ui-react') 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"); }); }); -- cgit 1.2.3-korg