diff --git a/src/routes/postWarning.ts b/src/routes/postWarning.ts index f003570..f9eaa4c 100644 --- a/src/routes/postWarning.ts +++ b/src/routes/postWarning.ts @@ -30,7 +30,7 @@ export async function postWarning(req: Request, res: Response): Promise { }) .catch(err => done(err)); }); + + it("Should be able to add your own warning", (done) => { + const json = { + userID: "warning-0" + }; + + client.post(endpoint, json) + .then(async res => { + assert.strictEqual(res.status, 403); + const data = await getWarning(warnedUser); + const expected = { + enabled: 0 + }; + assert.ok(partialDeepEquals(data, expected)); + done(); + }) + .catch(err => done(err)); + }); });