aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/api')
-rw-r--r--server/tests/api/check-params/follows.ts18
-rw-r--r--server/tests/api/follows.ts5
2 files changed, 2 insertions, 21 deletions
diff --git a/server/tests/api/check-params/follows.ts b/server/tests/api/check-params/follows.ts
index 0af1562f5..cdd2783df 100644
--- a/server/tests/api/check-params/follows.ts
+++ b/server/tests/api/check-params/follows.ts
@@ -184,25 +184,9 @@ describe('Test server follows API validators', function () {
184 .expect(403) 184 .expect(403)
185 }) 185 })
186 186
187 it('Should fail with an undefined id', async function () {
188 await request(server.url)
189 .delete(path + '/' + undefined)
190 .set('Authorization', 'Bearer ' + server.accessToken)
191 .set('Accept', 'application/json')
192 .expect(400)
193 })
194
195 it('Should fail with an invalid id', async function () {
196 await request(server.url)
197 .delete(path + '/foobar')
198 .set('Authorization', 'Bearer ' + server.accessToken)
199 .set('Accept', 'application/json')
200 .expect(400)
201 })
202
203 it('Should fail we do not follow this server', async function () { 187 it('Should fail we do not follow this server', async function () {
204 await request(server.url) 188 await request(server.url)
205 .delete(path + '/-1') 189 .delete(path + '/example.com')
206 .set('Authorization', 'Bearer ' + server.accessToken) 190 .set('Authorization', 'Bearer ' + server.accessToken)
207 .set('Accept', 'application/json') 191 .set('Accept', 'application/json')
208 .expect(404) 192 .expect(404)
diff --git a/server/tests/api/follows.ts b/server/tests/api/follows.ts
index dcb4c8bd9..10eb48969 100644
--- a/server/tests/api/follows.ts
+++ b/server/tests/api/follows.ts
@@ -23,7 +23,6 @@ const expect = chai.expect
23 23
24describe('Test follows', function () { 24describe('Test follows', function () {
25 let servers: ServerInfo[] = [] 25 let servers: ServerInfo[] = []
26 let server3Id: number
27 26
28 before(async function () { 27 before(async function () {
29 this.timeout(20000) 28 this.timeout(20000)
@@ -82,8 +81,6 @@ describe('Test follows', function () {
82 expect(server3Follow).to.not.be.undefined 81 expect(server3Follow).to.not.be.undefined
83 expect(server2Follow.state).to.equal('accepted') 82 expect(server2Follow.state).to.equal('accepted')
84 expect(server3Follow.state).to.equal('accepted') 83 expect(server3Follow.state).to.equal('accepted')
85
86 server3Id = server3Follow.following.id
87 }) 84 })
88 85
89 it('Should have 0 followings on server 1 and 2', async function () { 86 it('Should have 0 followings on server 1 and 2', async function () {
@@ -121,7 +118,7 @@ describe('Test follows', function () {
121 it('Should unfollow server 3 on server 1', async function () { 118 it('Should unfollow server 3 on server 1', async function () {
122 this.timeout(5000) 119 this.timeout(5000)
123 120
124 await unfollow(servers[0].url, servers[0].accessToken, server3Id) 121 await unfollow(servers[0].url, servers[0].accessToken, servers[2])
125 122
126 await wait(3000) 123 await wait(3000)
127 }) 124 })