From 98de9c6bfd8b3141afa119b609a1f877ea88b7b1 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 26 Jul 2017 12:05:48 +0300 Subject: [PATCH] test(cloudfunc) getTitle --- common/cloudfunc.js | 2 +- test/common/cloudfunc.js | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) 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(); +}); +