diff options
author | Rigel Kent <sendmemail@rigelk.eu> | 2021-06-01 01:36:53 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2021-06-02 16:57:07 +0200 |
commit | 76148b27f7501bac061992136852be4303370c8d (patch) | |
tree | fc0559253e833c9252fa14ebaec5321d88bfb4e8 /server/tests/api/users/users.ts | |
parent | 5ed25fb76e920dac364cb9ef46f14ec4bd372949 (diff) | |
download | PeerTube-76148b27f7501bac061992136852be4303370c8d.tar.gz PeerTube-76148b27f7501bac061992136852be4303370c8d.tar.zst PeerTube-76148b27f7501bac061992136852be4303370c8d.zip |
refactor API errors to standard error format
Diffstat (limited to 'server/tests/api/users/users.ts')
-rw-r--r-- | server/tests/api/users/users.ts | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/server/tests/api/users/users.ts b/server/tests/api/users/users.ts index cea98aac7..363236b62 100644 --- a/server/tests/api/users/users.ts +++ b/server/tests/api/users/users.ts | |||
@@ -93,16 +93,16 @@ describe('Test users', function () { | |||
93 | const client = { id: 'client', secret: server.client.secret } | 93 | const client = { id: 'client', secret: server.client.secret } |
94 | const res = await login(server.url, client, server.user, HttpStatusCode.BAD_REQUEST_400) | 94 | const res = await login(server.url, client, server.user, HttpStatusCode.BAD_REQUEST_400) |
95 | 95 | ||
96 | expect(res.body.code).to.equal('invalid_client') | 96 | expect(res.body.type).to.equal('invalid_client') |
97 | expect(res.body.error).to.contain('client is invalid') | 97 | expect(res.body.detail).to.contain('client is invalid') |
98 | }) | 98 | }) |
99 | 99 | ||
100 | it('Should not login with an invalid client secret', async function () { | 100 | it('Should not login with an invalid client secret', async function () { |
101 | const client = { id: server.client.id, secret: 'coucou' } | 101 | const client = { id: server.client.id, secret: 'coucou' } |
102 | const res = await login(server.url, client, server.user, HttpStatusCode.BAD_REQUEST_400) | 102 | const res = await login(server.url, client, server.user, HttpStatusCode.BAD_REQUEST_400) |
103 | 103 | ||
104 | expect(res.body.code).to.equal('invalid_client') | 104 | expect(res.body.type).to.equal('invalid_client') |
105 | expect(res.body.error).to.contain('client is invalid') | 105 | expect(res.body.detail).to.contain('client is invalid') |
106 | }) | 106 | }) |
107 | }) | 107 | }) |
108 | 108 | ||
@@ -112,16 +112,16 @@ describe('Test users', function () { | |||
112 | const user = { username: 'captain crochet', password: server.user.password } | 112 | const user = { username: 'captain crochet', password: server.user.password } |
113 | const res = await login(server.url, server.client, user, HttpStatusCode.BAD_REQUEST_400) | 113 | const res = await login(server.url, server.client, user, HttpStatusCode.BAD_REQUEST_400) |
114 | 114 | ||
115 | expect(res.body.code).to.equal('invalid_grant') | 115 | expect(res.body.type).to.equal('invalid_grant') |
116 | expect(res.body.error).to.contain('credentials are invalid') | 116 | expect(res.body.detail).to.contain('credentials are invalid') |
117 | }) | 117 | }) |
118 | 118 | ||
119 | it('Should not login with an invalid password', async function () { | 119 | it('Should not login with an invalid password', async function () { |
120 | const user = { username: server.user.username, password: 'mew_three' } | 120 | const user = { username: server.user.username, password: 'mew_three' } |
121 | const res = await login(server.url, server.client, user, HttpStatusCode.BAD_REQUEST_400) | 121 | const res = await login(server.url, server.client, user, HttpStatusCode.BAD_REQUEST_400) |
122 | 122 | ||
123 | expect(res.body.code).to.equal('invalid_grant') | 123 | expect(res.body.type).to.equal('invalid_grant') |
124 | expect(res.body.error).to.contain('credentials are invalid') | 124 | expect(res.body.detail).to.contain('credentials are invalid') |
125 | }) | 125 | }) |
126 | 126 | ||
127 | it('Should not be able to upload a video', async function () { | 127 | it('Should not be able to upload a video', async function () { |