From e6346d59e63135cf012ed18c102d3b0179ef565f Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 8 Jul 2021 15:54:39 +0200 Subject: Introduce playlist command --- server/tests/api/activitypub/client.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'server/tests/api/activitypub/client.ts') diff --git a/server/tests/api/activitypub/client.ts b/server/tests/api/activitypub/client.ts index be94e219c..e8536a214 100644 --- a/server/tests/api/activitypub/client.ts +++ b/server/tests/api/activitypub/client.ts @@ -6,7 +6,6 @@ import { VideoPlaylistPrivacy } from '@shared/models' import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' import { cleanupTests, - createVideoPlaylist, doubleFollow, flushAndRunMultipleServers, makeActivityPubGetRequest, @@ -74,9 +73,8 @@ describe('Test activitypub', function () { } { - const playlistAttrs = { displayName: 'playlist', privacy: VideoPlaylistPrivacy.PUBLIC, videoChannelId: servers[0].videoChannel.id } - const resCreate = await createVideoPlaylist({ url: servers[0].url, token: servers[0].accessToken, playlistAttrs }) - playlist = resCreate.body.videoPlaylist + const attributes = { displayName: 'playlist', privacy: VideoPlaylistPrivacy.PUBLIC, videoChannelId: servers[0].videoChannel.id } + playlist = await servers[0].playlistsCommand.create({ attributes }) } await doubleFollow(servers[0], servers[1]) -- cgit v1.2.3 From d23dd9fbfc4d26026352c10f81d2795ceaf2908a Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 15 Jul 2021 10:02:54 +0200 Subject: Introduce videos command --- server/tests/api/activitypub/client.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'server/tests/api/activitypub/client.ts') diff --git a/server/tests/api/activitypub/client.ts b/server/tests/api/activitypub/client.ts index e8536a214..0190df04c 100644 --- a/server/tests/api/activitypub/client.ts +++ b/server/tests/api/activitypub/client.ts @@ -2,8 +2,7 @@ import 'mocha' import * as chai from 'chai' -import { VideoPlaylistPrivacy } from '@shared/models' -import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' +import { HttpStatusCode } from '@shared/core-utils' import { cleanupTests, doubleFollow, @@ -11,9 +10,9 @@ import { makeActivityPubGetRequest, ServerInfo, setAccessTokensToServers, - setDefaultVideoChannel, - uploadVideoAndGetId -} from '../../../../shared/extra-utils' + setDefaultVideoChannel +} from '@shared/extra-utils' +import { VideoPlaylistPrivacy } from '@shared/models' const expect = chai.expect @@ -69,7 +68,7 @@ describe('Test activitypub', function () { await setDefaultVideoChannel(servers) { - video = await uploadVideoAndGetId({ server: servers[0], videoName: 'video' }) + video = await await servers[0].videosCommand.quickUpload({ name: 'video' }) } { -- cgit v1.2.3 From 89d241a79c262b9775c233b73cff080043ebb5e6 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 16 Jul 2021 09:04:35 +0200 Subject: Shorter server command names --- server/tests/api/activitypub/client.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'server/tests/api/activitypub/client.ts') diff --git a/server/tests/api/activitypub/client.ts b/server/tests/api/activitypub/client.ts index 0190df04c..5845045a3 100644 --- a/server/tests/api/activitypub/client.ts +++ b/server/tests/api/activitypub/client.ts @@ -68,12 +68,12 @@ describe('Test activitypub', function () { await setDefaultVideoChannel(servers) { - video = await await servers[0].videosCommand.quickUpload({ name: 'video' }) + video = await await servers[0].videos.quickUpload({ name: 'video' }) } { - const attributes = { displayName: 'playlist', privacy: VideoPlaylistPrivacy.PUBLIC, videoChannelId: servers[0].videoChannel.id } - playlist = await servers[0].playlistsCommand.create({ attributes }) + const attributes = { displayName: 'playlist', privacy: VideoPlaylistPrivacy.PUBLIC, videoChannelId: servers[0].store.channel.id } + playlist = await servers[0].playlists.create({ attributes }) } await doubleFollow(servers[0], servers[1]) -- cgit v1.2.3 From 254d3579f5338f5fd775c17d15cdfc37078bcfb4 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 16 Jul 2021 09:47:51 +0200 Subject: Use an object to represent a server --- server/tests/api/activitypub/client.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'server/tests/api/activitypub/client.ts') diff --git a/server/tests/api/activitypub/client.ts b/server/tests/api/activitypub/client.ts index 5845045a3..720231f02 100644 --- a/server/tests/api/activitypub/client.ts +++ b/server/tests/api/activitypub/client.ts @@ -6,9 +6,9 @@ import { HttpStatusCode } from '@shared/core-utils' import { cleanupTests, doubleFollow, - flushAndRunMultipleServers, + createMultipleServers, makeActivityPubGetRequest, - ServerInfo, + PeerTubeServer, setAccessTokensToServers, setDefaultVideoChannel } from '@shared/extra-utils' @@ -17,7 +17,7 @@ import { VideoPlaylistPrivacy } from '@shared/models' const expect = chai.expect describe('Test activitypub', function () { - let servers: ServerInfo[] = [] + let servers: PeerTubeServer[] = [] let video: { id: number, uuid: string, shortUUID: string } let playlist: { id: number, uuid: string, shortUUID: string } @@ -62,7 +62,7 @@ describe('Test activitypub', function () { before(async function () { this.timeout(30000) - servers = await flushAndRunMultipleServers(2) + servers = await createMultipleServers(2) await setAccessTokensToServers(servers) await setDefaultVideoChannel(servers) -- cgit v1.2.3 From c0e8b12e7fd554ba4d2ceb0c4900804c6a4c63ea Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 16 Jul 2021 10:42:24 +0200 Subject: Refactor requests --- server/tests/api/activitypub/client.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'server/tests/api/activitypub/client.ts') diff --git a/server/tests/api/activitypub/client.ts b/server/tests/api/activitypub/client.ts index 720231f02..53cc40663 100644 --- a/server/tests/api/activitypub/client.ts +++ b/server/tests/api/activitypub/client.ts @@ -2,7 +2,7 @@ import 'mocha' import * as chai from 'chai' -import { HttpStatusCode } from '@shared/core-utils' +import { HttpStatusCode } from '@shared/models' import { cleanupTests, doubleFollow, @@ -68,7 +68,7 @@ describe('Test activitypub', function () { await setDefaultVideoChannel(servers) { - video = await await servers[0].videos.quickUpload({ name: 'video' }) + video = await servers[0].videos.quickUpload({ name: 'video' }) } { -- cgit v1.2.3 From 4c7e60bc17ee5830399bac4aa273356903421b4c Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 16 Jul 2021 14:27:30 +0200 Subject: Reorganize imports --- server/tests/api/activitypub/client.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'server/tests/api/activitypub/client.ts') diff --git a/server/tests/api/activitypub/client.ts b/server/tests/api/activitypub/client.ts index 53cc40663..c3e4b7f74 100644 --- a/server/tests/api/activitypub/client.ts +++ b/server/tests/api/activitypub/client.ts @@ -2,17 +2,16 @@ import 'mocha' import * as chai from 'chai' -import { HttpStatusCode } from '@shared/models' import { cleanupTests, - doubleFollow, createMultipleServers, + doubleFollow, makeActivityPubGetRequest, PeerTubeServer, setAccessTokensToServers, setDefaultVideoChannel } from '@shared/extra-utils' -import { VideoPlaylistPrivacy } from '@shared/models' +import { HttpStatusCode, VideoPlaylistPrivacy } from '@shared/models' const expect = chai.expect -- cgit v1.2.3