From 0fd7a160ba4e1ca364aa2c9993bdaaf74e73191f Mon Sep 17 00:00:00 2001 From: mohamad khawam Date: Thu, 29 Feb 2024 14:57:21 -0500 Subject: [PATCH] Added Target and User Joined Test --- test/db.spec.ts | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/test/db.spec.ts b/test/db.spec.ts index e040f9b..b7e80ac 100644 --- a/test/db.spec.ts +++ b/test/db.spec.ts @@ -7,8 +7,8 @@ describe("DataBase", () => { }); }); - describe("Add Computer", () => { - it("should add a computer successfully", async () => { + describe("addTarget", () => { + it("should add a target successfully", async () => { const ip = "192.168.1.1"; const os = "linux"; const hostname = "myhost"; @@ -18,7 +18,7 @@ describe("DataBase", () => { assert.ok(result); }); }); - describe("Add User", () => { + describe("addUser", () => { it("should add a user successfully", async () => { const ip = "192.168.1.1"; const username = "testuser"; @@ -42,4 +42,17 @@ describe("DataBase", () => { assert.ok(!result, "added user to computer that doesnt exist"); }); }); + describe("addTargetAndUser", () => { + it("should add a target and user", async () => { + const ip = "192.168.1.3"; + const os = "linux"; + const hostname = "myhost"; + const domain = "example.com"; + const username = "username"; + const password = "password"; + const result = await db.addTargetAndUser(hostname, ip, username, password, os, domain); + + assert.ok(result); + }); + }); });