From 802dd501630946317516b86051ed022bbe70babe Mon Sep 17 00:00:00 2001 From: Michael C Date: Fri, 17 Sep 2021 00:01:29 -0400 Subject: [PATCH] naming --- test/cases/getIsUserVIP.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/test/cases/getIsUserVIP.ts b/test/cases/getIsUserVIP.ts index d380eea..fc0784e 100644 --- a/test/cases/getIsUserVIP.ts +++ b/test/cases/getIsUserVIP.ts @@ -4,14 +4,17 @@ import {db} from "../../src/databases/databases"; import {getHash} from "../../src/utils/getHash"; import assert from "assert"; +const endpoint = `${getbaseURL()}/api/isUserVIP`; +const VIPUser = "isUserVIPVIP"; +const normalUser = "isUserVIPNormal"; + describe("getIsUserVIP", () => { - const endpoint = `${getbaseURL()}/api/isUserVIP`; before(() => { - db.prepare("run", 'INSERT INTO "vipUsers" ("userID") VALUES (?)', [getHash("isUserVIPVIP")]); + db.prepare("run", 'INSERT INTO "vipUsers" ("userID") VALUES (?)', [getHash(VIPUser)]); }); it("Should be able to get a 200", (done: Done) => { - fetch(`${endpoint}?userID=isUserVIPVIP`) + fetch(`${endpoint}?userID=${VIPUser}`) .then(res => { assert.strictEqual(res.status, 200, "response should be 200"); done(); @@ -30,7 +33,7 @@ describe("getIsUserVIP", () => { }); it("Should say a VIP is a VIP", (done: Done) => { - fetch(`${endpoint}?userID=isUserVIPVIP`) + fetch(`${endpoint}?userID=${VIPUser}`) .then(async res => { assert.strictEqual(res.status, 200); const data = await res.json(); @@ -41,7 +44,7 @@ describe("getIsUserVIP", () => { }); it("Should say a normal user is not a VIP", (done: Done) => { - fetch(`${endpoint}?userID=isUserVIPNormal`) + fetch(`${endpoint}?userID=${normalUser}`) .then(async res => { assert.strictEqual(res.status, 200); const data = await res.json();