Added new NB overlapping code

This commit is contained in:
Ajay Ramachandran
2020-04-30 18:39:03 -04:00
parent abee010291
commit 8290c9e1f4
2 changed files with 19 additions and 9 deletions

View File

@@ -100,7 +100,7 @@ describe('postSkipSegments', () => {
});
});
it('Should be *rejected* if there\'s not at least 65% overlap with NB' , (done) => {
it("Should be rejected if there's not at least 65% overlap with NB", (done) => {
request.get(utils.getbaseURL()
+ "/api/postVideoSponsorTimes?videoID=LevkAjUE6d4&startTime=40&endTime=60&userID=testing", null,
(err, res, body) => {
@@ -110,7 +110,17 @@ describe('postSkipSegments', () => {
});
}).timeout(5000);
it('Should be *accepted* if there\'s at least 65% overlap with NB' , (done) => {
it("Should be accepted if only off by 5s", (done) => {
request.get(utils.getbaseURL()
+ "/api/postVideoSponsorTimes?videoID=LevkAjUE6d4&startTime=0&endTime=12&userID=testing", null,
(err, res, body) => {
if (err) done("Couldn't call endpoint");
else if (res.statusCode === 200) done(); // pass
else done("non 403 status code: " + res.statusCode + " ("+body+")");
});
}).timeout(5000);
it("Should be accepted if there's at least 65% overlap with NB" , (done) => {
request.get(utils.getbaseURL()
+ "/api/postVideoSponsorTimes?videoID=LevkAjUE6d4&startTime=0&endTime=6&userID=testing", null,
(err, res, body) => {