fix(cloudcmd) --console, --config-dialog: defaults

This commit is contained in:
coderaiser 2016-11-30 17:19:53 +02:00
parent e8f91f4908
commit eddb8bec4a
4 changed files with 44 additions and 9 deletions

View file

@ -5,6 +5,19 @@ const io = require('socket.io-client');
const before = require('./before');
test('cloudcmd: console: enabled by default', (t) => {
before({}, (port, after) => {
const socket = io(`http://localhost:${port}/console`)
socket.once('data', (data) => {
socket.close();
t.equal(data, 'client #1 console connected\n', 'should emit data event');
after();
t.end();
});
});
});
test('cloudcmd: console: enabled', (t) => {
const config = {console: true};

View file

@ -99,3 +99,22 @@ test('cloudcmd: rest: config: patch: no configDialog: statusCode', (t) => {
});
});
test('cloudcmd: rest: config: enabled by default', (t) => {
before({}, (port, after) => {
const json = {
auth: false,
};
patch(`http://localhost:${port}/api/v1/config`, json)
.then(warp(_pullout, 'string'))
.then((result) => {
t.equal(result, 'config: ok("auth")', 'should patch config');
t.end();
after();
})
.catch((error) => {
console.log(error);
});
});
});