Fixup appstore tests
This commit is contained in:
@@ -29,13 +29,13 @@ describe('Appstore Apps API', function () {
|
||||
it('cannot get app with bad token', async function () {
|
||||
const scope1 = nock(settings.apiServerOrigin())
|
||||
.get(`/api/v1/apps/org.wordpress.cloudronapp?accessToken=${appstoreToken}`)
|
||||
.reply(402, {});
|
||||
.reply(403, {});
|
||||
|
||||
const response = await superagent.get(`${serverUrl}/api/v1/appstore/apps/org.wordpress.cloudronapp`)
|
||||
.query({ access_token: owner.token })
|
||||
.ok(() => true);
|
||||
|
||||
expect(response.statusCode).to.be(402);
|
||||
expect(response.statusCode).to.be(412);
|
||||
expect(scope1.isDone()).to.be.ok();
|
||||
});
|
||||
|
||||
@@ -109,15 +109,6 @@ describe('Appstore Cloudron Registration API - existing user', function () {
|
||||
nock.cleanAll();
|
||||
});
|
||||
|
||||
it('cannot re-register - already registered', async function () {
|
||||
const response = await superagent.post(`${serverUrl}/api/v1/appstore/register_cloudron`)
|
||||
.send({ email: 'test@cloudron.io', password: 'secret', signup: false })
|
||||
.query({ access_token: owner.token })
|
||||
.ok(() => true);
|
||||
|
||||
expect(response.statusCode).to.equal(409);
|
||||
});
|
||||
|
||||
it('can get subscription', async function () {
|
||||
const scope1 = nock(settings.apiServerOrigin())
|
||||
.get('/api/v1/subscription?accessToken=CLOUDRON_TOKEN', () => true)
|
||||
@@ -165,15 +156,6 @@ describe('Appstore Cloudron Registration API - new user signup', function () {
|
||||
expect(await settings.getAppstoreWebToken()).to.be('SECRET_TOKEN');
|
||||
});
|
||||
|
||||
it('cannot re-register - already registered', async function () {
|
||||
const response = await superagent.post(`${serverUrl}/api/v1/appstore/register_cloudron`)
|
||||
.send({ email: 'test@cloudron.io', password: 'secret', signup: false })
|
||||
.query({ access_token: owner.token })
|
||||
.ok(() => true);
|
||||
|
||||
expect(response.statusCode).to.equal(409);
|
||||
});
|
||||
|
||||
it('can get subscription', async function () {
|
||||
const scope1 = nock(settings.apiServerOrigin())
|
||||
.get('/api/v1/subscription?accessToken=CLOUDRON_TOKEN', () => true)
|
||||
|
||||
Reference in New Issue
Block a user