From 8560c3f6735bf7bb4e5ec0b25f00427220ba3f14 Mon Sep 17 00:00:00 2001 From: Michael C Date: Tue, 28 Jun 2022 15:02:09 -0400 Subject: [PATCH] add tests for #454 --- test/cases/voteOnSponsorTime.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/cases/voteOnSponsorTime.ts b/test/cases/voteOnSponsorTime.ts index 9fad1db..9b33862 100644 --- a/test/cases/voteOnSponsorTime.ts +++ b/test/cases/voteOnSponsorTime.ts @@ -628,4 +628,17 @@ describe("voteOnSponsorTime", () => { done(); }); }); + + it("Should not be able to revive full video segment as non-vip", (done) => { + const UUID = "full-video-uuid-1"; + postVote("VIPUser", UUID, 0); // downvote as VIP + postVote("randomID3", UUID, 1) + .then(async res => { + assert.strictEqual(res.status, 200); + const row = await getSegmentVotes(UUID); + assert.strictEqual(row.votes, -2); + done(); + }) + .catch(err => done(err)); + }); });