aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/friends-basic.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/api/friends-basic.ts')
-rw-r--r--server/tests/api/friends-basic.ts19
1 files changed, 18 insertions, 1 deletions
diff --git a/server/tests/api/friends-basic.ts b/server/tests/api/friends-basic.ts
index 13edf6273..efca4fda2 100644
--- a/server/tests/api/friends-basic.ts
+++ b/server/tests/api/friends-basic.ts
@@ -15,7 +15,8 @@ import {
15 makeFriends, 15 makeFriends,
16 getFriendsList, 16 getFriendsList,
17 dateIsValid, 17 dateIsValid,
18 quitOneFriend 18 quitOneFriend,
19 getPodsListPaginationAndSort
19} from '../utils' 20} from '../utils'
20 21
21describe('Test basic friends', function () { 22describe('Test basic friends', function () {
@@ -120,6 +121,22 @@ describe('Test basic friends', function () {
120 await makeFriends(server.url, server.accessToken, 409) 121 await makeFriends(server.url, server.accessToken, 409)
121 }) 122 })
122 123
124 it('Should list friends correctly', async function () {
125 const start = 1
126 const count = 1
127 const sort = '-host'
128
129 const res = await getPodsListPaginationAndSort(servers[0].url, start, count, sort)
130 expect(res.body.total).to.equal(2)
131 expect(res.body.data).to.have.lengthOf(1)
132
133 const pod = res.body.data[0]
134 expect(pod.host).to.equal('localhost:9002')
135 expect(pod.email).to.equal('admin2@example.com')
136 expect(pod.score).to.equal(20)
137 expect(dateIsValid(pod.createdAt)).to.be.true
138 })
139
123 it('Should quit friends of pod 2', async function () { 140 it('Should quit friends of pod 2', async function () {
124 this.timeout(10000) 141 this.timeout(10000)
125 142