mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2024-11-10 01:02:30 +01:00
Merge pull request #472 from mchangrh/addl_poi_tests
add additional poi_highlight tests
This commit is contained in:
commit
5e4773afdd
1 changed files with 41 additions and 0 deletions
|
@ -54,6 +54,7 @@ describe("lockCategoriesRecords", () => {
|
||||||
await db.prepare("run", insertLockCategoryQuery, [lockVIPUserHash, "delete-record-1", "mute", "sponsor", "reason-5", "YouTube"]);
|
await db.prepare("run", insertLockCategoryQuery, [lockVIPUserHash, "delete-record-1", "mute", "sponsor", "reason-5", "YouTube"]);
|
||||||
await db.prepare("run", insertLockCategoryQuery, [lockVIPUserHash, "delete-record-1", "skip", "intro", "reason-5", "YouTube"]);
|
await db.prepare("run", insertLockCategoryQuery, [lockVIPUserHash, "delete-record-1", "skip", "intro", "reason-5", "YouTube"]);
|
||||||
await db.prepare("run", insertLockCategoryQuery, [lockVIPUserHash, "delete-record-1", "mute", "intro", "reason-5", "YouTube"]);
|
await db.prepare("run", insertLockCategoryQuery, [lockVIPUserHash, "delete-record-1", "mute", "intro", "reason-5", "YouTube"]);
|
||||||
|
await db.prepare("run", insertLockCategoryQuery, [lockVIPUserHash, "delete-record-poi", "poi", "poi_highlight", "reason-6", "YouTube"]);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("Should update the database version when starting the application", async () => {
|
it("Should update the database version when starting the application", async () => {
|
||||||
|
@ -519,4 +520,44 @@ describe("lockCategoriesRecords", () => {
|
||||||
})
|
})
|
||||||
.catch(err => done(err));
|
.catch(err => done(err));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("should be able to delete poi type category by type poi", (done) => {
|
||||||
|
const videoID = "delete-record-poi";
|
||||||
|
const json = {
|
||||||
|
videoID,
|
||||||
|
userID: lockVIPUser,
|
||||||
|
categories: [
|
||||||
|
"poi_highlight",
|
||||||
|
],
|
||||||
|
actionTypes: ["poi"]
|
||||||
|
};
|
||||||
|
client.delete(endpoint, { data: json })
|
||||||
|
.then(async res => {
|
||||||
|
assert.strictEqual(res.status, 200);
|
||||||
|
const result = await checkLockCategories(videoID);
|
||||||
|
assert.strictEqual(result.length, 0);
|
||||||
|
done();
|
||||||
|
})
|
||||||
|
.catch(err => done(err));
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should be able to delete poi type category by type poi", (done) => {
|
||||||
|
const videoID = "delete-record-poi";
|
||||||
|
const json = {
|
||||||
|
videoID,
|
||||||
|
userID: lockVIPUser,
|
||||||
|
categories: [
|
||||||
|
"poi_highlight",
|
||||||
|
],
|
||||||
|
actionTypes: ["poi"]
|
||||||
|
};
|
||||||
|
client.delete(endpoint, { data: json })
|
||||||
|
.then(async res => {
|
||||||
|
assert.strictEqual(res.status, 200);
|
||||||
|
const result = await checkLockCategories(videoID);
|
||||||
|
assert.strictEqual(result.length, 0);
|
||||||
|
done();
|
||||||
|
})
|
||||||
|
.catch(err => done(err));
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue