test(package) gritty: terminal enabled

This commit is contained in:
coderaiser 2018-05-11 15:33:17 +03:00
parent 9c18764178
commit 9b2c276036
4 changed files with 22 additions and 6 deletions

View file

@ -243,7 +243,7 @@ test('cloudcmd: route: sendIndex: encode', async (t) => {
t.ok(data.includes(nameEncoded), 'should encode name');
clear('flop');
mockRequire.stop('flop');
clear(routePath);
clear('../../server/cloudcmd');
clear(beforePath);
@ -277,7 +277,7 @@ test('cloudcmd: route: sendIndex: encode: not encoded', async (t) => {
t.notOk(data.includes(name), 'should not put not encoded name');
clear('flop');
mockRequire.stop('flop');
clear(routePath);
clear('../../server/cloudcmd');
clear(beforePath);
@ -312,7 +312,7 @@ test('cloudcmd: route: sendIndex: ddos: render', async (t) => {
t.pass('should not hang up');
clear('flop');
mockRequire.stop('flo');
clear(routePath);
clear(cloudcmdPath);
clear(beforePath);
@ -335,3 +335,18 @@ test('cloudcmd: route: buttons: no terminal', async (t) => {
t.end();
});
test('cloudcmd: route: buttons: terminal', async (t) => {
const config = {
terminal: true,
terminalPath: 'gritty',
};
const {port, done} = await connect({config});
const result = await getStr(`http://localhost:${port}`);
t.notOk(/icon-terminal none/.test(result), 'should enable terminal');
done();
t.end();
});

View file

@ -97,6 +97,8 @@ test('cloudcmd: terminal: no arg', (t) => {
t.equal(result, gritty, 'should equal');
mock.stop('gritty');
clean(configPath);
require(configPath);