aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/friends-basic.js
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/api/friends-basic.js')
-rw-r--r--server/tests/api/friends-basic.js16
1 files changed, 8 insertions, 8 deletions
diff --git a/server/tests/api/friends-basic.js b/server/tests/api/friends-basic.js
index a871f9838..6f37ff291 100644
--- a/server/tests/api/friends-basic.js
+++ b/server/tests/api/friends-basic.js
@@ -28,7 +28,7 @@ describe('Test basic friends', function () {
28 podsUtils.getFriendsList(serverToTest.url, function (err, res) { 28 podsUtils.getFriendsList(serverToTest.url, function (err, res) {
29 if (err) throw err 29 if (err) throw err
30 30
31 const result = res.body 31 const result = res.body.data
32 expect(result).to.be.an('array') 32 expect(result).to.be.an('array')
33 expect(result.length).to.equal(2) 33 expect(result.length).to.equal(2)
34 34
@@ -65,7 +65,7 @@ describe('Test basic friends', function () {
65 podsUtils.getFriendsList(server.url, function (err, res) { 65 podsUtils.getFriendsList(server.url, function (err, res) {
66 if (err) throw err 66 if (err) throw err
67 67
68 const result = res.body 68 const result = res.body.data
69 expect(result).to.be.an('array') 69 expect(result).to.be.an('array')
70 expect(result.length).to.equal(0) 70 expect(result.length).to.equal(0)
71 callback() 71 callback()
@@ -90,14 +90,14 @@ describe('Test basic friends', function () {
90 podsUtils.getFriendsList(servers[1].url, function (err, res) { 90 podsUtils.getFriendsList(servers[1].url, function (err, res) {
91 if (err) throw err 91 if (err) throw err
92 92
93 const result = res.body 93 const result = res.body.data
94 expect(result).to.be.an('array') 94 expect(result).to.be.an('array')
95 expect(result.length).to.equal(1) 95 expect(result.length).to.equal(1)
96 96
97 const pod = result[0] 97 const pod = result[0]
98 expect(pod.host).to.equal(servers[2].host) 98 expect(pod.host).to.equal(servers[2].host)
99 expect(pod.score).to.equal(20) 99 expect(pod.score).to.equal(20)
100 expect(miscsUtils.dateIsValid(pod.createdDate)).to.be.true 100 expect(miscsUtils.dateIsValid(pod.createdAt)).to.be.true
101 101
102 next() 102 next()
103 }) 103 })
@@ -107,14 +107,14 @@ describe('Test basic friends', function () {
107 podsUtils.getFriendsList(servers[2].url, function (err, res) { 107 podsUtils.getFriendsList(servers[2].url, function (err, res) {
108 if (err) throw err 108 if (err) throw err
109 109
110 const result = res.body 110 const result = res.body.data
111 expect(result).to.be.an('array') 111 expect(result).to.be.an('array')
112 expect(result.length).to.equal(1) 112 expect(result.length).to.equal(1)
113 113
114 const pod = result[0] 114 const pod = result[0]
115 expect(pod.host).to.equal(servers[1].host) 115 expect(pod.host).to.equal(servers[1].host)
116 expect(pod.score).to.equal(20) 116 expect(pod.score).to.equal(20)
117 expect(miscsUtils.dateIsValid(pod.createdDate)).to.be.true 117 expect(miscsUtils.dateIsValid(pod.createdAt)).to.be.true
118 118
119 next() 119 next()
120 }) 120 })
@@ -154,7 +154,7 @@ describe('Test basic friends', function () {
154 podsUtils.getFriendsList(servers[1].url, function (err, res) { 154 podsUtils.getFriendsList(servers[1].url, function (err, res) {
155 if (err) throw err 155 if (err) throw err
156 156
157 const result = res.body 157 const result = res.body.data
158 expect(result).to.be.an('array') 158 expect(result).to.be.an('array')
159 expect(result.length).to.equal(0) 159 expect(result.length).to.equal(0)
160 160
@@ -167,7 +167,7 @@ describe('Test basic friends', function () {
167 podsUtils.getFriendsList(url, function (err, res) { 167 podsUtils.getFriendsList(url, function (err, res) {
168 if (err) throw err 168 if (err) throw err
169 169
170 const result = res.body 170 const result = res.body.data
171 expect(result).to.be.an('array') 171 expect(result).to.be.an('array')
172 expect(result.length).to.equal(1) 172 expect(result.length).to.equal(1)
173 expect(result[0].host).not.to.be.equal(servers[1].host) 173 expect(result[0].host).not.to.be.equal(servers[1].host)