From a6a79eae0d8564099b6957e76d7a18528d9ef124 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 5 Jul 2021 14:57:03 +0200 Subject: Introduce bulk command --- server/tests/api/server/bulk.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'server/tests/api') diff --git a/server/tests/api/server/bulk.ts b/server/tests/api/server/bulk.ts index 80fa7fce6..ca98a2eb2 100644 --- a/server/tests/api/server/bulk.ts +++ b/server/tests/api/server/bulk.ts @@ -6,7 +6,7 @@ import { Video, VideoComment } from '@shared/models' import { addVideoCommentReply, addVideoCommentThread, - bulkRemoveCommentsOf, + BulkCommand, cleanupTests, createUser, doubleFollow, @@ -30,6 +30,8 @@ describe('Test bulk actions', function () { let user2AccessToken: string let user3AccessToken: string + let bulkCommand: BulkCommand + before(async function () { this.timeout(30000) @@ -60,6 +62,8 @@ describe('Test bulk actions', function () { } await doubleFollow(servers[0], servers[1]) + + bulkCommand = new BulkCommand(servers[0]) }) describe('Bulk remove comments', function () { @@ -133,8 +137,7 @@ describe('Test bulk actions', function () { it('Should delete comments of an account on my videos', async function () { this.timeout(60000) - await bulkRemoveCommentsOf({ - url: servers[0].url, + await bulkCommand.removeCommentsOf({ token: user1AccessToken, attributes: { accountName: 'user2', @@ -164,9 +167,7 @@ describe('Test bulk actions', function () { it('Should delete comments of an account on the instance', async function () { this.timeout(60000) - await bulkRemoveCommentsOf({ - url: servers[0].url, - token: servers[0].accessToken, + await bulkCommand.removeCommentsOf({ attributes: { accountName: 'user3@localhost:' + servers[1].port, scope: 'instance' -- cgit v1.2.3