mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-14 15:37:07 +03:00
Unlock segment if VIP downvotes
This commit is contained in:
@@ -465,4 +465,22 @@ describe('voteOnSponsorTime', () => {
|
||||
.catch(err => done(err));
|
||||
});
|
||||
|
||||
it('VIP downvote should unlock segment', (done: Done) => {
|
||||
fetch(getbaseURL()
|
||||
+ "/api/voteOnSponsorTime?userID=VIPUser&UUID=segment-locking-uuid-1&type=0")
|
||||
.then(res => {
|
||||
if (res.status === 200) {
|
||||
let row = db.prepare('get', "SELECT locked FROM sponsorTimes WHERE UUID = ?", ["segment-locking-uuid-1"]);
|
||||
if (!row?.locked) {
|
||||
done();
|
||||
} else {
|
||||
done("Segment not locked");
|
||||
}
|
||||
} else {
|
||||
done("Status code was " + res.status + " instead of 200");
|
||||
}
|
||||
})
|
||||
.catch(err => done(err));
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user