diff --git a/common/cloudfunc.js b/common/cloudfunc.js index 4364c667..5332b97d 100644 --- a/common/cloudfunc.js +++ b/common/cloudfunc.js @@ -34,7 +34,7 @@ module.exports.formatMsg = (msg, name, status) => { * @path */ module.exports.getTitle = (path) => { - return NAME + ' - ' + (path || Path()); + return NAME + ' - ' + (path || Path()); }; /** Функция получает адреса каждого каталога в пути diff --git a/test/common/cloudfunc.js b/test/common/cloudfunc.js index e27718ea..ffcbb2ee 100644 --- a/test/common/cloudfunc.js +++ b/test/common/cloudfunc.js @@ -53,7 +53,7 @@ let Expect = '' + ''; -test('render', (t) => { +test('cloudfunc: render', (t) => { const paths = {}; const filesList = TMPL_PATH .map((name) => { @@ -144,3 +144,17 @@ test('cloudfunc: formatMsg', (t) => { t.end(); }); +test('cloudfunc: getTitle', (t) => { + const result = CloudFunc.getTitle(); + + t.equal(result, 'Cloud Commander - /'); + t.end(); +}); + +test('cloudfunc: getTitle', (t) => { + const result = CloudFunc.getTitle('/hello/world'); + + t.equal(result, 'Cloud Commander - /hello/world'); + t.end(); +}); +