aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/api')
-rw-r--r--server/tests/api/server/follows.ts40
1 files changed, 39 insertions, 1 deletions
diff --git a/server/tests/api/server/follows.ts b/server/tests/api/server/follows.ts
index 310c291bf..e80e93e7f 100644
--- a/server/tests/api/server/follows.ts
+++ b/server/tests/api/server/follows.ts
@@ -93,7 +93,26 @@ describe('Test follows', function () {
93 expect(server3Follow.state).to.equal('accepted') 93 expect(server3Follow.state).to.equal('accepted')
94 }) 94 })
95 95
96 it('Should have 0 followings on server 1 and 2', async function () { 96 it('Should search followings on server 1', async function () {
97 {
98 const res = await getFollowingListPaginationAndSort(servers[ 0 ].url, 0, 1, 'createdAt', ':9002')
99 const follows = res.body.data
100
101 expect(res.body.total).to.equal(1)
102 expect(follows.length).to.equal(1)
103 expect(follows[ 0 ].following.host).to.equal('localhost:9002')
104 }
105
106 {
107 const res = await getFollowingListPaginationAndSort(servers[ 0 ].url, 0, 1, 'createdAt', 'bla')
108 const follows = res.body.data
109
110 expect(res.body.total).to.equal(0)
111 expect(follows.length).to.equal(0)
112 }
113 })
114
115 it('Should have 0 followings on server 2 and 3', async function () {
97 for (const server of [ servers[1], servers[2] ]) { 116 for (const server of [ servers[1], servers[2] ]) {
98 const res = await getFollowingListPaginationAndSort(server.url, 0, 5, 'createdAt') 117 const res = await getFollowingListPaginationAndSort(server.url, 0, 5, 'createdAt')
99 const follows = res.body.data 118 const follows = res.body.data
@@ -116,6 +135,25 @@ describe('Test follows', function () {
116 } 135 }
117 }) 136 })
118 137
138 it('Should search followers on server 2', async function () {
139 {
140 const res = await getFollowersListPaginationAndSort(servers[ 2 ].url, 0, 5, 'createdAt', '9001')
141 const follows = res.body.data
142
143 expect(res.body.total).to.equal(1)
144 expect(follows.length).to.equal(1)
145 expect(follows[ 0 ].following.host).to.equal('localhost:9003')
146 }
147
148 {
149 const res = await getFollowersListPaginationAndSort(servers[ 2 ].url, 0, 5, 'createdAt', 'bla')
150 const follows = res.body.data
151
152 expect(res.body.total).to.equal(0)
153 expect(follows.length).to.equal(0)
154 }
155 })
156
119 it('Should have 0 followers on server 1', async function () { 157 it('Should have 0 followers on server 1', async function () {
120 const res = await getFollowersListPaginationAndSort(servers[0].url, 0, 5, 'createdAt') 158 const res = await getFollowersListPaginationAndSort(servers[0].url, 0, 5, 'createdAt')
121 const follows = res.body.data 159 const follows = res.body.data