- await makeGetRequest({ url: server.url, token: server.accessToken, path: myHistoryPath, statusCodeExpected: 200 })
+ await makeGetRequest({ url: server.url, token: server.accessToken, path: myHistoryPath, expectedStatus: HttpStatusCode.OK_200 })
+ })
+ })
+
+ describe('When removing a specific user video history element', function () {
+ let path: string
+
+ before(function () {
+ path = myHistoryPath + '/' + videoId
+ })
+
+ it('Should fail with an unauthenticated user', async function () {
+ await makeDeleteRequest({ url: server.url, path, expectedStatus: HttpStatusCode.UNAUTHORIZED_401 })
+ })
+
+ it('Should fail with a bad videoId parameter', async function () {
+ await makeDeleteRequest({
+ url: server.url,
+ token: server.accessToken,
+ path: myHistoryRemove + '/hi',
+ expectedStatus: HttpStatusCode.BAD_REQUEST_400
+ })
+ })
+
+ it('Should succeed with the correct parameters', async function () {
+ await makeDeleteRequest({
+ url: server.url,
+ token: server.accessToken,
+ path,
+ expectedStatus: HttpStatusCode.NO_CONTENT_204
+ })