aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-01-08 15:11:38 +0100
committerChocobozzz <me@florianbigard.com>2020-01-08 15:44:41 +0100
commite612209767ebe1deb0af7688c96b7f979bb52b44 (patch)
treec5be9241e41a098f5452fe3cd187e2305d8047e3 /server/tests
parent440d39c52d4efb878b6a2e21584d6b8f52072f27 (diff)
downloadPeerTube-e612209767ebe1deb0af7688c96b7f979bb52b44.tar.gz
PeerTube-e612209767ebe1deb0af7688c96b7f979bb52b44.tar.zst
PeerTube-e612209767ebe1deb0af7688c96b7f979bb52b44.zip
Try to fix subscriptions inconsistencies
Diffstat (limited to 'server/tests')
-rw-r--r--server/tests/api/activitypub/helpers.ts7
-rw-r--r--server/tests/api/server/follows.ts2
2 files changed, 3 insertions, 6 deletions
diff --git a/server/tests/api/activitypub/helpers.ts b/server/tests/api/activitypub/helpers.ts
index 0d1f154fe..8c00ba3d6 100644
--- a/server/tests/api/activitypub/helpers.ts
+++ b/server/tests/api/activitypub/helpers.ts
@@ -76,7 +76,6 @@ describe('Test activity pub helpers', function () {
76 const mastodonObject = cloneDeep(require('./json/mastodon/bad-http-signature.json')) 76 const mastodonObject = cloneDeep(require('./json/mastodon/bad-http-signature.json'))
77 req.body = mastodonObject.body 77 req.body = mastodonObject.body
78 req.headers = mastodonObject.headers 78 req.headers = mastodonObject.headers
79 req.headers.signature = 'Signature ' + req.headers.signature
80 79
81 const parsed = parseHTTPSignature(req, 3600 * 1000 * 365 * 10) 80 const parsed = parseHTTPSignature(req, 3600 * 1000 * 365 * 10)
82 const publicKey = require('./json/mastodon/public-key.json').publicKey 81 const publicKey = require('./json/mastodon/public-key.json').publicKey
@@ -95,7 +94,6 @@ describe('Test activity pub helpers', function () {
95 const mastodonObject = cloneDeep(require('./json/mastodon/http-signature.json')) 94 const mastodonObject = cloneDeep(require('./json/mastodon/http-signature.json'))
96 req.body = mastodonObject.body 95 req.body = mastodonObject.body
97 req.headers = mastodonObject.headers 96 req.headers = mastodonObject.headers
98 req.headers.signature = 'Signature ' + req.headers.signature
99 97
100 const parsed = parseHTTPSignature(req, 3600 * 1000 * 365 * 10) 98 const parsed = parseHTTPSignature(req, 3600 * 1000 * 365 * 10)
101 const publicKey = require('./json/mastodon/bad-public-key.json').publicKey 99 const publicKey = require('./json/mastodon/bad-public-key.json').publicKey
@@ -114,7 +112,6 @@ describe('Test activity pub helpers', function () {
114 const mastodonObject = cloneDeep(require('./json/mastodon/http-signature.json')) 112 const mastodonObject = cloneDeep(require('./json/mastodon/http-signature.json'))
115 req.body = mastodonObject.body 113 req.body = mastodonObject.body
116 req.headers = mastodonObject.headers 114 req.headers = mastodonObject.headers
117 req.headers.signature = 'Signature ' + req.headers.signature
118 115
119 let errored = false 116 let errored = false
120 try { 117 try {
@@ -126,7 +123,7 @@ describe('Test activity pub helpers', function () {
126 expect(errored).to.be.true 123 expect(errored).to.be.true
127 }) 124 })
128 125
129 it('Should fail without scheme', async function () { 126 it('Should with a scheme', async function () {
130 const req = buildRequestStub() 127 const req = buildRequestStub()
131 req.method = 'POST' 128 req.method = 'POST'
132 req.url = '/accounts/ronan/inbox' 129 req.url = '/accounts/ronan/inbox'
@@ -134,6 +131,7 @@ describe('Test activity pub helpers', function () {
134 const mastodonObject = cloneDeep(require('./json/mastodon/http-signature.json')) 131 const mastodonObject = cloneDeep(require('./json/mastodon/http-signature.json'))
135 req.body = mastodonObject.body 132 req.body = mastodonObject.body
136 req.headers = mastodonObject.headers 133 req.headers = mastodonObject.headers
134 req.headers = 'Signature ' + mastodonObject.headers
137 135
138 let errored = false 136 let errored = false
139 try { 137 try {
@@ -153,7 +151,6 @@ describe('Test activity pub helpers', function () {
153 const mastodonObject = cloneDeep(require('./json/mastodon/http-signature.json')) 151 const mastodonObject = cloneDeep(require('./json/mastodon/http-signature.json'))
154 req.body = mastodonObject.body 152 req.body = mastodonObject.body
155 req.headers = mastodonObject.headers 153 req.headers = mastodonObject.headers
156 req.headers.signature = 'Signature ' + req.headers.signature
157 154
158 const parsed = parseHTTPSignature(req, 3600 * 1000 * 365 * 10) 155 const parsed = parseHTTPSignature(req, 3600 * 1000 * 365 * 10)
159 const publicKey = require('./json/mastodon/public-key.json').publicKey 156 const publicKey = require('./json/mastodon/public-key.json').publicKey
diff --git a/server/tests/api/server/follows.ts b/server/tests/api/server/follows.ts
index 60dbe2e6d..4ffa9e791 100644
--- a/server/tests/api/server/follows.ts
+++ b/server/tests/api/server/follows.ts
@@ -419,7 +419,7 @@ describe('Test follows', function () {
419 await expectAccountFollows(servers[1].url, 'peertube@localhost:' + servers[0].port, 0, 1) 419 await expectAccountFollows(servers[1].url, 'peertube@localhost:' + servers[0].port, 0, 1)
420 await expectAccountFollows(servers[1].url, 'peertube@localhost:' + servers[1].port, 1, 0) 420 await expectAccountFollows(servers[1].url, 'peertube@localhost:' + servers[1].port, 1, 0)
421 421
422 await expectAccountFollows(servers[2].url, 'peertube@localhost:' + servers[0].port, 0, 2) 422 await expectAccountFollows(servers[2].url, 'peertube@localhost:' + servers[0].port, 0, 1)
423 await expectAccountFollows(servers[2].url, 'peertube@localhost:' + servers[2].port, 1, 0) 423 await expectAccountFollows(servers[2].url, 'peertube@localhost:' + servers[2].port, 1, 0)
424 }) 424 })
425 425