aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/videos
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2023-07-28 16:28:16 +0200
committerChocobozzz <me@florianbigard.com>2023-07-28 16:33:12 +0200
commit982edf32ae436424e9b1ebf7f13696e4871ce202 (patch)
treeb8ca5ae0c1fb27c014d22d4c5d0df63afbb5443a /server/tests/api/videos
parentce8d0b5aaeb968d774ab2390461eec687d4730f4 (diff)
downloadPeerTube-982edf32ae436424e9b1ebf7f13696e4871ce202.tar.gz
PeerTube-982edf32ae436424e9b1ebf7f13696e4871ce202.tar.zst
PeerTube-982edf32ae436424e9b1ebf7f13696e4871ce202.zip
Remove deprecated video query filter
Diffstat (limited to 'server/tests/api/videos')
-rw-r--r--server/tests/api/videos/videos-common-filters.ts74
1 files changed, 0 insertions, 74 deletions
diff --git a/server/tests/api/videos/videos-common-filters.ts b/server/tests/api/videos/videos-common-filters.ts
index fac0f5dc5..48de7c537 100644
--- a/server/tests/api/videos/videos-common-filters.ts
+++ b/server/tests/api/videos/videos-common-filters.ts
@@ -74,80 +74,6 @@ describe('Test videos filter', function () {
74 ] 74 ]
75 }) 75 })
76 76
77 describe('Check deprecated videos filter', function () {
78
79 async function getVideosNames (options: {
80 server: PeerTubeServer
81 token: string
82 filter: string
83 skipSubscription?: boolean
84 expectedStatus?: HttpStatusCode
85 }) {
86 const { server, token, filter, skipSubscription = false, expectedStatus = HttpStatusCode.OK_200 } = options
87
88 const videosResults: Video[][] = []
89
90 for (const path of paths) {
91 if (skipSubscription && path === subscriptionVideosPath) continue
92
93 const res = await makeGetRequest({
94 url: server.url,
95 path,
96 token,
97 query: {
98 sort: 'createdAt',
99 filter
100 },
101 expectedStatus
102 })
103
104 videosResults.push(res.body.data.map(v => v.name))
105 }
106
107 return videosResults
108 }
109
110 it('Should display local videos', async function () {
111 for (const server of servers) {
112 const namesResults = await getVideosNames({ server, token: server.accessToken, filter: 'local' })
113 for (const names of namesResults) {
114 expect(names).to.have.lengthOf(1)
115 expect(names[0]).to.equal('public ' + server.serverNumber)
116 }
117 }
118 })
119
120 it('Should display all local videos by the admin or the moderator', async function () {
121 for (const server of servers) {
122 for (const token of [ server.accessToken, server['moderatorAccessToken'] ]) {
123
124 const namesResults = await getVideosNames({ server, token, filter: 'all-local', skipSubscription: true })
125 for (const names of namesResults) {
126 expect(names).to.have.lengthOf(3)
127
128 expect(names[0]).to.equal('public ' + server.serverNumber)
129 expect(names[1]).to.equal('unlisted ' + server.serverNumber)
130 expect(names[2]).to.equal('private ' + server.serverNumber)
131 }
132 }
133 }
134 })
135
136 it('Should display all videos by the admin or the moderator', async function () {
137 for (const server of servers) {
138 for (const token of [ server.accessToken, server['moderatorAccessToken'] ]) {
139
140 const [ channelVideos, accountVideos, videos, searchVideos ] = await getVideosNames({ server, token, filter: 'all' })
141 expect(channelVideos).to.have.lengthOf(3)
142 expect(accountVideos).to.have.lengthOf(3)
143
144 expect(videos).to.have.lengthOf(5)
145 expect(searchVideos).to.have.lengthOf(5)
146 }
147 }
148 })
149 })
150
151 describe('Check videos filters', function () { 77 describe('Check videos filters', function () {
152 78
153 async function listVideos (options: { 79 async function listVideos (options: {