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 @@
...
@@ -20,14 +20,13 @@
declareJavascript
,
declareJavascript
,
methods
;
methods
;
function
RenderJSGadget
()
{
function
RenderJSGadget
()
{}
this
.
title
=
""
;
RenderJSGadget
.
prototype
.
title
=
""
;
this
.
interface_list
=
[];
RenderJSGadget
.
prototype
.
interface_list
=
[];
this
.
path
=
""
;
RenderJSGadget
.
prototype
.
path
=
""
;
this
.
html
=
""
;
RenderJSGadget
.
prototype
.
html
=
""
;
this
.
required_css_list
=
[];
RenderJSGadget
.
prototype
.
required_css_list
=
[];
this
.
required_js_list
=
[];
RenderJSGadget
.
prototype
.
required_js_list
=
[];
}
// Returns the list of gadget prototype
// Returns the list of gadget prototype
RenderJSGadget
.
prototype
.
getInterfaceList
=
function
()
{
RenderJSGadget
.
prototype
.
getInterfaceList
=
function
()
{
...
...
test/renderjs_test2.js
View file @
6d43204c
...
@@ -755,6 +755,19 @@
...
@@ -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
// RenderJSGadget.getRequiredCSSList
/////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
...
@@ -773,6 +786,19 @@
...
@@ -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
// RenderJSGadget.getRequiredJSList
/////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
...
@@ -791,11 +817,24 @@
...
@@ -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
// RenderJSGadget.getPath
/////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
module
(
"
RenderJSGadget.getPath
"
);
module
(
"
RenderJSGadget.getPath
"
);
test
(
'
returns
interface_list
'
,
function
()
{
test
(
'
returns
path
'
,
function
()
{
// Check that getPath return a Promise
// Check that getPath return a Promise
var
gadget
=
new
RenderJSGadget
();
var
gadget
=
new
RenderJSGadget
();
gadget
.
path
=
"
foo
"
;
gadget
.
path
=
"
foo
"
;
...
@@ -809,11 +848,24 @@
...
@@ -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
// RenderJSGadget.getTitle
/////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
module
(
"
RenderJSGadget.getTitle
"
);
module
(
"
RenderJSGadget.getTitle
"
);
test
(
'
returns
interface_list
'
,
function
()
{
test
(
'
returns
title
'
,
function
()
{
// Check that getTitle return a Promise
// Check that getTitle return a Promise
var
gadget
=
new
RenderJSGadget
();
var
gadget
=
new
RenderJSGadget
();
gadget
.
title
=
"
foo
"
;
gadget
.
title
=
"
foo
"
;
...
@@ -827,11 +879,24 @@
...
@@ -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
// RenderJSGadget.getHTML
/////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
module
(
"
RenderJSGadget.getHTML
"
);
module
(
"
RenderJSGadget.getHTML
"
);
test
(
'
returns
interface_list
'
,
function
()
{
test
(
'
returns
html
'
,
function
()
{
// Check that getHTML return a Promise
// Check that getHTML return a Promise
var
gadget
=
new
RenderJSGadget
();
var
gadget
=
new
RenderJSGadget
();
gadget
.
html
=
"
foo
"
;
gadget
.
html
=
"
foo
"
;
...
@@ -845,4 +910,17 @@
...
@@ -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
));
}(
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