test: fix various routes tests
* system/disks routes is gone * provision routes now return 405 instead of 409 when re-setup/re-activated
This commit is contained in:
@@ -216,20 +216,20 @@ describe('Provision', function () {
|
||||
expect(response.body.token).to.be.a('string');
|
||||
});
|
||||
|
||||
it('fails the second time', async function () {
|
||||
it('activate fails the second time', async function () {
|
||||
const response = await superagent.post(`${serverUrl}/api/v1/provision/activate`)
|
||||
.send({ username: owner.username, password: owner.password, email: owner.email, displayName: owner.displayName })
|
||||
.ok(() => true);
|
||||
|
||||
expect(response.statusCode).to.eql(409);
|
||||
expect(response.statusCode).to.eql(405); // route unavailable post activation
|
||||
});
|
||||
|
||||
it('after fails', async function () {
|
||||
it('seutp fails after activation', async function () {
|
||||
const response = await superagent.post(`${serverUrl}/api/v1/provision/setup`)
|
||||
.send({ domainConfig: { provider: 'noop', domain: DOMAIN, adminFqdn: 'my.' + DOMAIN, config: {}, tlsConfig: { provider: 'fallback' } } })
|
||||
.ok(() => true);
|
||||
|
||||
expect(response.statusCode).to.eql(409);
|
||||
expect(response.statusCode).to.eql(405);
|
||||
});
|
||||
|
||||
it('device left first time mode', async function () {
|
||||
|
||||
@@ -127,17 +127,6 @@ describe('System', function () {
|
||||
});
|
||||
});
|
||||
|
||||
describe('disks', function () {
|
||||
it('succeeds', async function () {
|
||||
const response = await superagent.get(`${serverUrl}/api/v1/system/disks`)
|
||||
.query({ access_token: owner.token });
|
||||
|
||||
expect(response.statusCode).to.equal(200);
|
||||
expect(response.body.disks).to.be.ok();
|
||||
expect(Object.keys(response.body.disks).some(fs => response.body.disks[fs].mountpoint === '/')).to.be(true);
|
||||
});
|
||||
});
|
||||
|
||||
describe('disk usage', function () {
|
||||
it('get succeeds with no cache', async function () {
|
||||
safe.fs.unlinkSync(paths.DISK_USAGE_FILE);
|
||||
|
||||
Reference in New Issue
Block a user