mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 02:35:49 +00:00
fix(route) termianl -> terminal
This commit is contained in:
parent
e54a722ec5
commit
daa45cc516
2 changed files with 64 additions and 1 deletions
|
|
@ -93,7 +93,7 @@ function indexProcessing(options) {
|
|||
|
||||
if (noTerminal)
|
||||
data = data
|
||||
.replace('icon-terminal', 'icon-termianl none');
|
||||
.replace('icon-terminal', 'icon-terminal none');
|
||||
|
||||
let left = rendy(Template.panel, {
|
||||
side : 'left',
|
||||
|
|
|
|||
|
|
@ -1,7 +1,26 @@
|
|||
'use strict';
|
||||
|
||||
const test = require('tape');
|
||||
const promisify = require('es6-promisify');
|
||||
const pullout = require('pullout');
|
||||
const request = require('request');
|
||||
|
||||
const route = require('../../server/route');
|
||||
const before = require('../before');
|
||||
|
||||
const warp = (fn, ...a) => (...b) => fn(...b, ...a);
|
||||
const _pullout = promisify(pullout);
|
||||
|
||||
const get = promisify((url, fn) => {
|
||||
fn(null, request(url));
|
||||
});
|
||||
|
||||
const getStr = (url) => {
|
||||
return get(url)
|
||||
.then(warp(_pullout, 'string'))
|
||||
.catch(console.log);
|
||||
};
|
||||
|
||||
|
||||
test('cloudcmd: route: no args', (t) => {
|
||||
t.throws(route, /req could not be empty!/, 'should throw when no args');
|
||||
|
|
@ -22,3 +41,47 @@ test('cloudcmd: route: no next', (t) => {
|
|||
t.end();
|
||||
});
|
||||
|
||||
test('cloudcmd: route: buttons: no console', (t) => {
|
||||
const config = {
|
||||
console: false
|
||||
};
|
||||
|
||||
before({config}, (port, after) => {
|
||||
getStr(`http://localhost:${port}/`)
|
||||
.then((result) => {
|
||||
t.ok(/icon-console none/.test(result), 'should hide console');
|
||||
t.end();
|
||||
after();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
test('cloudcmd: route: buttons: no terminal', (t) => {
|
||||
const config = {
|
||||
terminal: false
|
||||
};
|
||||
|
||||
before({config}, (port, after) => {
|
||||
getStr(`http://localhost:${port}/`)
|
||||
.then((result) => {
|
||||
t.ok(/icon-terminal none/.test(result), 'should hide terminal');
|
||||
t.end();
|
||||
after();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
test('cloudcmd: route: buttons: no config', (t) => {
|
||||
const config = {
|
||||
configDialog: false
|
||||
};
|
||||
|
||||
before({config}, (port, after) => {
|
||||
getStr(`http://localhost:${port}/`)
|
||||
.then((result) => {
|
||||
t.ok(/icon-config none/.test(result), 'should hide config');
|
||||
t.end();
|
||||
after();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue