Fix tests

This commit is contained in:
Girish Ramakrishnan
2021-11-17 11:14:33 -08:00
parent a7fe7b0aa3
commit 515b1db9d0
6 changed files with 10 additions and 8 deletions

View File

@@ -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() {

View File

@@ -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();

View File

@@ -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);
});
});