Fix getSkipSegmentsByHash requires valid json

The categories parameter has to be a valid array with strings in JSON format
This commit is contained in:
Nanobyte
2021-02-25 19:08:29 +01:00
parent e86f442249
commit 09c9b25178
2 changed files with 20 additions and 8 deletions

View File

@@ -96,10 +96,10 @@ describe('getSegmentsByHash', () => {
.catch(err => done("Couldn't call endpoint"));
});
it('Should return 500 for bad format categories', (done: Done) => { // should probably be 400
fetch(getbaseURL() + '/api/skipSegments/?categories=shilling')
it('Should return 400 for bad format categories', (done: Done) => {
fetch(getbaseURL() + '/api/skipSegments/fdaf?categories=shilling')
.then(res => {
if (res.status !== 500) done("expected 500 got " + res.status);
if (res.status !== 400) done("expected 400 got " + res.status);
else done(); // pass
})
.catch(err => done("Couldn't call endpoint"));