aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/plugins/plugin-helpers.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-08-02 15:29:00 +0200
committerChocobozzz <me@florianbigard.com>2022-08-02 15:50:05 +0200
commit22df69fdecf299c8be6acaa25f086249ea9a0085 (patch)
treee8c7e21c18fb42bb74b54f2eab1509c3d93a380d /server/tests/plugins/plugin-helpers.ts
parent7a9e420a02434e4f16c99e7d58da9075dff25d15 (diff)
downloadPeerTube-22df69fdecf299c8be6acaa25f086249ea9a0085.tar.gz
PeerTube-22df69fdecf299c8be6acaa25f086249ea9a0085.tar.zst
PeerTube-22df69fdecf299c8be6acaa25f086249ea9a0085.zip
Add job queue hooks
Diffstat (limited to 'server/tests/plugins/plugin-helpers.ts')
-rw-r--r--server/tests/plugins/plugin-helpers.ts23
1 files changed, 23 insertions, 0 deletions
diff --git a/server/tests/plugins/plugin-helpers.ts b/server/tests/plugins/plugin-helpers.ts
index 5e8d08dff..49807f8f5 100644
--- a/server/tests/plugins/plugin-helpers.ts
+++ b/server/tests/plugins/plugin-helpers.ts
@@ -110,6 +110,7 @@ describe('Test plugin helpers', function () {
110 }) 110 })
111 111
112 describe('User', function () { 112 describe('User', function () {
113 let rootId: number
113 114
114 it('Should not get a user if not authenticated', async function () { 115 it('Should not get a user if not authenticated', async function () {
115 await makeGetRequest({ 116 await makeGetRequest({
@@ -132,6 +133,28 @@ describe('Test plugin helpers', function () {
132 expect(res.body.isAdmin).to.be.true 133 expect(res.body.isAdmin).to.be.true
133 expect(res.body.isModerator).to.be.false 134 expect(res.body.isModerator).to.be.false
134 expect(res.body.isUser).to.be.false 135 expect(res.body.isUser).to.be.false
136
137 rootId = res.body.id
138 })
139
140 it('Should load a user by id', async function () {
141 {
142 const res = await makeGetRequest({
143 url: servers[0].url,
144 path: '/plugins/test-four/router/user/' + rootId,
145 expectedStatus: HttpStatusCode.OK_200
146 })
147
148 expect(res.body.username).to.equal('root')
149 }
150
151 {
152 await makeGetRequest({
153 url: servers[0].url,
154 path: '/plugins/test-four/router/user/42',
155 expectedStatus: HttpStatusCode.NOT_FOUND_404
156 })
157 }
135 }) 158 })
136 }) 159 })
137 160