Fix tests

This commit is contained in:
Girish Ramakrishnan
2025-10-07 09:34:35 +02:00
parent 3a0febe760
commit 6869380500
4 changed files with 28 additions and 5 deletions

View File

@@ -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`)