From c55603b615a057d482dc9abb81688d7d8b98ffdb Mon Sep 17 00:00:00 2001 From: Alexandru-Paul Dumitru Date: Wed, 4 Dec 2019 13:49:34 +0100 Subject: [PATCH] add unit test for getEtag and setEtag in ZoweUSSNode Signed-off-by: Alexandru-Paul Dumitru --- __tests__/__unit__/ZoweUSSNode.unit.test.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/__tests__/__unit__/ZoweUSSNode.unit.test.ts b/__tests__/__unit__/ZoweUSSNode.unit.test.ts index 781f7e1151..6b50ff3510 100644 --- a/__tests__/__unit__/ZoweUSSNode.unit.test.ts +++ b/__tests__/__unit__/ZoweUSSNode.unit.test.ts @@ -199,4 +199,22 @@ describe("Unit Tests (Jest)", () => { utils.labelHack(rootNode); expect(rootNode.label === "gappy"); }); + + /************************************************************************************************************* + * Checks that getEtag() returns a value + *************************************************************************************************************/ + it("Checks that getEtag() returns a value", async () => { + const rootNode = new ZoweUSSNode("gappy", vscode.TreeItemCollapsibleState.Collapsed, null, session, null, null, null, "123"); + expect(rootNode.getEtag() === "123"); + }); + + /************************************************************************************************************* + * Checks that setEtag() assigns a value + *************************************************************************************************************/ + it("Checks that setEtag() assigns a value", async () => { + const rootNode = new ZoweUSSNode("gappy", vscode.TreeItemCollapsibleState.Collapsed, null, session, null, null, null, "123"); + expect(rootNode.getEtag() === "123"); + rootNode.setEtag("ABC"); + expect(rootNode.getEtag() === "ABC"); + }); });