Fix tests
This commit is contained in:
@@ -140,14 +140,22 @@ async function setup() {
|
||||
const scope1 = nock(await appstore.getApiServerOrigin())
|
||||
.post('/api/v1/register_cloudron3', (body) => typeof body.domain === 'string' && typeof body.version === 'string')
|
||||
.reply(201, { cloudronId: 'cid', cloudronToken: 'CLOUDRON_TOKEN' });
|
||||
|
||||
const scope2 = nock(await appstore.getApiServerOrigin())
|
||||
.post('/api/v1/subscription3?accessToken=CLOUDRON_TOKEN', (body) => typeof body.state === 'object' && typeof body.state.userCount === 'number')
|
||||
.reply(200, { features: {} });
|
||||
|
||||
response = await superagent.post(`${serverUrl}/api/v1/provision/activate`)
|
||||
.query({ setupToken: 'somesetuptoken' })
|
||||
.send({ username: owner.username, password: owner.password, email: owner.email });
|
||||
.send({ username: owner.username, password: owner.password, email: owner.email })
|
||||
.ok(() => true);
|
||||
expect(response.status).to.eql(201);
|
||||
owner.token = response.body.token;
|
||||
owner.id = response.body.userId;
|
||||
expect(scope1.isDone()).to.be.ok();
|
||||
scope1.persist(false);
|
||||
expect(scope2.isDone()).to.be.ok();
|
||||
scope2.persist(false);
|
||||
|
||||
// create an admin
|
||||
response = await superagent.post(`${serverUrl}/api/v1/users`)
|
||||
|
||||
Reference in New Issue
Block a user