Fix tests
This commit is contained in:
@@ -81,6 +81,8 @@ async function setup() {
|
||||
// HACK to get a token for second user (passwords are generated and the user should have gotten a password setup link...)
|
||||
const token = await tokens.add({ identifier: user.id, clientId: 'test-client-id', expires: Date.now() + (60 * 60 * 1000), name: 'fromtest' });
|
||||
user.token = token.accessToken;
|
||||
|
||||
await settings._set(settings.CLOUDRON_TOKEN_KEY, exports.appstoreToken); // appstore token
|
||||
}
|
||||
|
||||
async function cleanup() {
|
||||
|
||||
@@ -49,7 +49,7 @@ describe('Profile API', function () {
|
||||
expect(response.statusCode).to.equal(200);
|
||||
expect(response.body.username).to.equal(owner.username.toLowerCase());
|
||||
expect(response.body.email).to.equal(owner.email.toLowerCase());
|
||||
expect(response.body.fallbackEmail).to.equal(owner.email.toLowerCase());
|
||||
expect(response.body.fallbackEmail).to.equal('');
|
||||
expect(response.body.displayName).to.be.a('string');
|
||||
expect(response.body.password).to.not.be.ok();
|
||||
expect(response.body.salt).to.not.be.ok();
|
||||
|
||||
@@ -185,11 +185,11 @@ describe('Users API', function () {
|
||||
it('sending succeeds', async function () {
|
||||
common.clearMailQueue();
|
||||
|
||||
const response = await superagent.post(`${serverUrl}/api/v1/users/${user.id}/send_invite`)
|
||||
const response = await superagent.post(`${serverUrl}/api/v1/users/${user.id}/send_invite_email`)
|
||||
.query({ access_token: owner.token })
|
||||
.send({});
|
||||
.send({ email: user.email });
|
||||
|
||||
expect(response.statusCode).to.equal(200);
|
||||
expect(response.statusCode).to.equal(202);
|
||||
await common.checkMails(1);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user