mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2026-03-14 06:22:48 +03:00
add innertube tests for private videos
This commit is contained in:
@@ -46,4 +46,9 @@ describe("innertube API test", function() {
|
||||
const videoDetail = await getVideoDetails(videoID);
|
||||
assert.ok(videoDetail);
|
||||
});
|
||||
it("Should not fail when getting data for private video", async function () {
|
||||
const privateVideoId = "ZuibAax0VD8";
|
||||
const videoDetail = await getVideoDetails(privateVideoId);
|
||||
assert.ok(videoDetail);
|
||||
});
|
||||
});
|
||||
@@ -1292,4 +1292,20 @@ describe("postSkipSegments", () => {
|
||||
})
|
||||
.catch(err => done(err));
|
||||
});
|
||||
|
||||
it("Should successfully submit if video is private", (done) => {
|
||||
const videoID = "private-video";
|
||||
postSkipSegmentParam({
|
||||
videoID,
|
||||
startTime: 1,
|
||||
endTime: 5,
|
||||
category: "sponsor",
|
||||
userID: submitUserTwo
|
||||
})
|
||||
.then(res => {
|
||||
assert.strictEqual(res.status, 200);
|
||||
done();
|
||||
})
|
||||
.catch(err => done(err));
|
||||
});
|
||||
});
|
||||
|
||||
@@ -63,6 +63,11 @@ export class YouTubeApiMock {
|
||||
lengthSeconds: 100,
|
||||
} as APIVideoData
|
||||
};
|
||||
} else if (obj.id === "private-video") {
|
||||
return {
|
||||
err: false,
|
||||
data: {} as APIVideoData
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
err: false,
|
||||
|
||||
Reference in New Issue
Block a user