Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
renderjs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gabriel Monnerat
renderjs
Commits
6d43204c
Commit
6d43204c
authored
Jul 09, 2013
by
Romain Courteaud
🐸
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix gadget methods default values.
parent
3c7624d6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
88 additions
and
11 deletions
+88
-11
renderjs.js
renderjs.js
+7
-8
test/renderjs_test2.js
test/renderjs_test2.js
+81
-3
No files found.
renderjs.js
View file @
6d43204c
...
...
@@ -20,14 +20,13 @@
declareJavascript
,
methods
;
function
RenderJSGadget
()
{
this
.
title
=
""
;
this
.
interface_list
=
[];
this
.
path
=
""
;
this
.
html
=
""
;
this
.
required_css_list
=
[];
this
.
required_js_list
=
[];
}
function
RenderJSGadget
()
{}
RenderJSGadget
.
prototype
.
title
=
""
;
RenderJSGadget
.
prototype
.
interface_list
=
[];
RenderJSGadget
.
prototype
.
path
=
""
;
RenderJSGadget
.
prototype
.
html
=
""
;
RenderJSGadget
.
prototype
.
required_css_list
=
[];
RenderJSGadget
.
prototype
.
required_js_list
=
[];
// Returns the list of gadget prototype
RenderJSGadget
.
prototype
.
getInterfaceList
=
function
()
{
...
...
test/renderjs_test2.js
View file @
6d43204c
...
...
@@ -755,6 +755,19 @@
});
});
test
(
'
default value
'
,
function
()
{
// Check that getInterfaceList return a Promise
var
gadget
=
new
RenderJSGadget
();
stop
();
gadget
.
getInterfaceList
()
.
done
(
function
(
result
)
{
deepEqual
(
result
,
[]);
})
.
always
(
function
()
{
start
();
});
});
/////////////////////////////////////////////////////////////////
// RenderJSGadget.getRequiredCSSList
/////////////////////////////////////////////////////////////////
...
...
@@ -773,6 +786,19 @@
});
});
test
(
'
default value
'
,
function
()
{
// Check that getRequiredCSSList return a Promise
var
gadget
=
new
RenderJSGadget
();
stop
();
gadget
.
getRequiredCSSList
()
.
done
(
function
(
result
)
{
deepEqual
(
result
,
[]);
})
.
always
(
function
()
{
start
();
});
});
/////////////////////////////////////////////////////////////////
// RenderJSGadget.getRequiredJSList
/////////////////////////////////////////////////////////////////
...
...
@@ -791,11 +817,24 @@
});
});
test
(
'
default value
'
,
function
()
{
// Check that getRequiredJSList return a Promise
var
gadget
=
new
RenderJSGadget
();
stop
();
gadget
.
getRequiredJSList
()
.
done
(
function
(
result
)
{
deepEqual
(
result
,
[]);
})
.
always
(
function
()
{
start
();
});
});
/////////////////////////////////////////////////////////////////
// RenderJSGadget.getPath
/////////////////////////////////////////////////////////////////
module
(
"
RenderJSGadget.getPath
"
);
test
(
'
returns
interface_list
'
,
function
()
{
test
(
'
returns
path
'
,
function
()
{
// Check that getPath return a Promise
var
gadget
=
new
RenderJSGadget
();
gadget
.
path
=
"
foo
"
;
...
...
@@ -809,11 +848,24 @@
});
});
test
(
'
default value
'
,
function
()
{
// Check that getPath return a Promise
var
gadget
=
new
RenderJSGadget
();
stop
();
gadget
.
getPath
()
.
done
(
function
(
result
)
{
equal
(
result
,
""
);
})
.
always
(
function
()
{
start
();
});
});
/////////////////////////////////////////////////////////////////
// RenderJSGadget.getTitle
/////////////////////////////////////////////////////////////////
module
(
"
RenderJSGadget.getTitle
"
);
test
(
'
returns
interface_list
'
,
function
()
{
test
(
'
returns
title
'
,
function
()
{
// Check that getTitle return a Promise
var
gadget
=
new
RenderJSGadget
();
gadget
.
title
=
"
foo
"
;
...
...
@@ -827,11 +879,24 @@
});
});
test
(
'
default value
'
,
function
()
{
// Check that getTitle return a Promise
var
gadget
=
new
RenderJSGadget
();
stop
();
gadget
.
getTitle
()
.
done
(
function
(
result
)
{
equal
(
result
,
""
);
})
.
always
(
function
()
{
start
();
});
});
/////////////////////////////////////////////////////////////////
// RenderJSGadget.getHTML
/////////////////////////////////////////////////////////////////
module
(
"
RenderJSGadget.getHTML
"
);
test
(
'
returns
interface_list
'
,
function
()
{
test
(
'
returns
html
'
,
function
()
{
// Check that getHTML return a Promise
var
gadget
=
new
RenderJSGadget
();
gadget
.
html
=
"
foo
"
;
...
...
@@ -845,4 +910,17 @@
});
});
test
(
'
default value
'
,
function
()
{
// Check that getHTML return a Promise
var
gadget
=
new
RenderJSGadget
();
stop
();
gadget
.
getHTML
()
.
done
(
function
(
result
)
{
equal
(
result
,
""
);
})
.
always
(
function
()
{
start
();
});
});
}(
document
,
jQuery
,
renderJS
,
QUnit
,
sinon
));
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment