mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-20 18:18:56 +00:00
test(cloudfunc) add path-link
This commit is contained in:
parent
d77ac56f0f
commit
fd98f12c65
1 changed files with 11 additions and 9 deletions
|
|
@ -13,9 +13,10 @@
|
|||
TEMPLATEPATH = FS_DIR + 'file.html',
|
||||
LINK_TEMPLATE_PATH = FS_DIR + 'link.html',
|
||||
PATHTEMPLATE_PATH = FS_DIR + 'path.html',
|
||||
PATH_LINK = FS_DIR + 'path-link.html',
|
||||
EXPECT_PATH = DIR + 'test/lib/cloudfunc.html',
|
||||
|
||||
Files = [TEMPLATEPATH, PATHTEMPLATE_PATH, LINK_TEMPLATE_PATH, EXPECT_PATH],
|
||||
Files = [TEMPLATEPATH, PATHTEMPLATE_PATH, LINK_TEMPLATE_PATH, EXPECT_PATH, PATH_LINK],
|
||||
|
||||
JSON_FILES = {
|
||||
path : '/etc/X11/',
|
||||
|
|
@ -34,14 +35,14 @@
|
|||
|
||||
Expect =
|
||||
'<div data-name="js-path" class="reduce-text" title="/etc/X11/">' +
|
||||
'<span data-name="js-clear-storage" class="path-icon clear-storage" ' +
|
||||
'<span data-name="js-clear-storage" class="path-icon clear-storage" ' +
|
||||
'title="clear storage (Ctrl+D)">' +
|
||||
'</span>' +
|
||||
'<a data-name="js-refresh" href="/fs/etc/X11" ' +
|
||||
'class="path-icon refresh-icon" title="refresh (Ctrl+R)"></a>' +
|
||||
'<span data-name="js-links" class=links>' +
|
||||
'<a href="/fs" title="/">/</a>' +
|
||||
'<a href="/fs/etc" title="/etc">' +
|
||||
'<a data-name="js-path-link" href="/fs/" title="/">/</a>' +
|
||||
'<a data-name="js-path-link" href="/fs/etc/" title="/etc/">'+
|
||||
'etc' +
|
||||
'</a>/X11/' +
|
||||
'</span>' +
|
||||
|
|
@ -49,7 +50,7 @@
|
|||
|
||||
exports.check = function() {
|
||||
files.read(Files, 'utf-8', function(errors, files) {
|
||||
var isNotOk, i, template, pathTemplate, linkTemplate, expect, result;
|
||||
var isNotOk, i, template, pathTemplate, pathLink, linkTemplate, expect, result;
|
||||
|
||||
if (errors)
|
||||
Util.log(errors);
|
||||
|
|
@ -58,15 +59,17 @@
|
|||
|
||||
template = files[TEMPLATEPATH];
|
||||
pathTemplate = files[PATHTEMPLATE_PATH];
|
||||
pathLink = files[PATH_LINK],
|
||||
linkTemplate = files[LINK_TEMPLATE_PATH];
|
||||
expect = files[EXPECT_PATH];
|
||||
|
||||
result = CloudFunc.buildFromJSON({
|
||||
data: JSON_FILES,
|
||||
template: {
|
||||
file: template,
|
||||
path: pathTemplate,
|
||||
link: linkTemplate
|
||||
file : template,
|
||||
path : pathTemplate,
|
||||
pathLink : pathLink,
|
||||
link : linkTemplate
|
||||
}
|
||||
});
|
||||
|
||||
|
|
@ -89,7 +92,6 @@
|
|||
'Result: ' + result.substr(i) );
|
||||
|
||||
throw('buildFromJSON: Not OK');
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue