Fixup oidc client route tests
This commit is contained in:
@@ -12,12 +12,14 @@ const common = require('./common.js'),
|
||||
|
||||
const CLIENT_0 = {
|
||||
id: 'client0',
|
||||
name: 'test client 0',
|
||||
secret: 'secret0',
|
||||
loginRedirectUri: 'http://foo.bar'
|
||||
};
|
||||
|
||||
const CLIENT_1 = {
|
||||
id: 'client1',
|
||||
name: 'test client 1',
|
||||
secret: 'secret1',
|
||||
loginRedirectUri: 'https://cloudron.io/login',
|
||||
logoutRedirectUri: 'https://cloudron.io/logout'
|
||||
@@ -145,7 +147,7 @@ describe('OpenID connect clients API', function () {
|
||||
it('can update client without logoutRedirectUri', async function () {
|
||||
const response = await superagent.post(`${serverUrl}/api/v1/oidc/clients/${CLIENT_0.id}`)
|
||||
.query({ access_token: owner.token })
|
||||
.send({ secret: 'newsecret', loginRedirectUri: CLIENT_0.loginRedirectUri })
|
||||
.send({ secret: 'newsecret', name: 'new name', loginRedirectUri: CLIENT_0.loginRedirectUri })
|
||||
.ok(() => true);
|
||||
|
||||
expect(response.statusCode).to.equal(201);
|
||||
@@ -155,12 +157,13 @@ describe('OpenID connect clients API', function () {
|
||||
|
||||
expect(response2.statusCode).to.equal(200);
|
||||
expect(response2.body.secret).to.equal('newsecret');
|
||||
expect(response2.body.name).to.equal('new name');
|
||||
});
|
||||
|
||||
it('can update client with logoutRedirectUri', async function () {
|
||||
const response = await superagent.post(`${serverUrl}/api/v1/oidc/clients/${CLIENT_0.id}`)
|
||||
.query({ access_token: owner.token })
|
||||
.send({ secret: 'newsecret', loginRedirectUri: CLIENT_0.loginRedirectUri, logoutRedirectUri: CLIENT_1.logoutRedirectUri })
|
||||
.send({ secret: 'newsecret', name: CLIENT_1.name, loginRedirectUri: CLIENT_0.loginRedirectUri, logoutRedirectUri: CLIENT_1.logoutRedirectUri })
|
||||
.ok(() => true);
|
||||
|
||||
expect(response.statusCode).to.equal(201);
|
||||
|
||||
Reference in New Issue
Block a user