+ describe('When listing user videos history', function () {
+ it('Should fail with a bad start pagination', async function () {
+ await checkBadStartPagination(server.url, myHistoryPath, server.accessToken)
+ })
+
+ it('Should fail with a bad count pagination', async function () {
+ await checkBadCountPagination(server.url, myHistoryPath, server.accessToken)
+ })
+
+ it('Should fail with an unauthenticated user', async function () {
+ await makeGetRequest({ url: server.url, path: myHistoryPath, statusCodeExpected: 401 })
+ })
+
+ it('Should succeed with the correct params', async function () {
+ await makeGetRequest({ url: server.url, token: server.accessToken, path: myHistoryPath, statusCodeExpected: 200 })
+ })
+ })
+
+ describe('When removing user videos history', function () {
+ it('Should fail with an unauthenticated user', async function () {
+ await makePostBodyRequest({ url: server.url, path: myHistoryPath + '/remove', statusCodeExpected: 401 })
+ })
+
+ it('Should fail with a bad beforeDate parameter', async function () {
+ const body = { beforeDate: '15' }
+ await makePostBodyRequest({
+ url: server.url,
+ token: server.accessToken,
+ path: myHistoryRemove,
+ fields: body,
+ statusCodeExpected: 400
+ })
+ })