Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
officejs
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
officejs
Commits
2056f6ce
Commit
2056f6ce
authored
Oct 25, 2013
by
Thibaut Frain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Jquery spreadsheet test refactoring
parent
8b5ed49a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
28 deletions
+24
-28
test/jqs-gadget-test.html
test/jqs-gadget-test.html
+1
-1
test/jqs-gadget-test.js
test/jqs-gadget-test.js
+23
-27
No files found.
test/jqs-gadget-test.html
View file @
2056f6ce
...
...
@@ -18,6 +18,6 @@
<body>
<div
id=
"qunit"
></div>
<div
id=
"qunit-fixture"
></div>
<div
class=
"jqs-
gadget"
style=
"display:none;"
></div>
<div
id=
"
gadget"
style=
"display:none;"
></div>
</body>
</html>
test/jqs-gadget-test.js
View file @
2056f6ce
...
...
@@ -5,16 +5,12 @@
QUnit
.
config
.
testTimeout
=
1000
;
(
function
(
window
,
$
,
QUnit
,
rJS
)
{
//var test = QUnit.test,
var
asyncTest
=
QUnit
.
asyncTest
,
//stop = QUnit.stop,
start
=
QUnit
.
start
,
ok
=
QUnit
.
ok
,
equal
=
QUnit
.
equal
,
expect
=
QUnit
.
expect
,
//throws = QUnit.throws,
//deepEqual = QUnit.deepEqual;
gadgetURL
=
'
../deploy/gadget/jqs.html
'
;
jqsGadgetURL
=
'
../deploy/gadget/jqs.html
'
;
function
iframeSelector
(
selectorString
)
{
return
$
(
'
iframe
'
).
contents
().
find
(
selectorString
);
...
...
@@ -27,37 +23,37 @@ QUnit.config.testTimeout = 1000;
rJS
(
window
).
ready
(
function
()
{
var
g
=
rJS
(
this
),
jqs_context
=
g
.
context
.
find
(
'
.jqs-
gadget
'
).
first
();
gadget_context
=
g
.
context
.
find
(
'
#
gadget
'
).
first
();
asyncTest
(
"
jquery.sheet loading : sheet loads
"
,
2
,
function
()
{
g
.
declareIframedGadget
(
gadgetURL
,
jqs_context
);
setTimeout
(
function
()
{
var
c0r0
=
buildSelector
(
0
,
0
,
0
);
var
c1r1
=
buildSelector
(
0
,
1
,
1
);
ok
(
iframeSelector
(
c0r0
).
length
!=
0
);
ok
(
iframeSelector
(
c1r1
).
length
!=
0
);
start
();
},
100
);
var
c0r0
=
buildSelector
(
0
,
0
,
0
);
var
c1r1
=
buildSelector
(
0
,
1
,
1
);
g
.
declareIframedGadget
(
jqsGadgetURL
,
gadget_context
)
.
then
(
function
()
{
ok
(
iframeSelector
(
c0r0
).
length
!=
0
);
ok
(
iframeSelector
(
c1r1
).
length
!=
0
);
})
.
always
(
start
);
});
asyncTest
(
"
jquery.sheet loading : sheet is empty
"
,
2
,
function
()
{
g
.
declareIframedGadget
(
gadgetURL
,
jqs_context
);
var
c0r0
=
buildSelector
(
0
,
0
,
0
);
var
c1r1
=
buildSelector
(
0
,
1
,
1
);
setTimeout
(
function
()
{
equal
(
iframeSelector
(
c0r0
).
html
(),
""
);
equal
(
iframeSelector
(
c1r1
).
html
(),
""
);
start
();
},
100
);
g
.
declareIframedGadget
(
jqsGadgetURL
,
gadget_context
)
.
then
(
function
()
{
equal
(
iframeSelector
(
c0r0
).
html
(),
""
);
equal
(
iframeSelector
(
c1r1
).
html
(),
""
);
})
.
always
(
start
);
});
asyncTest
(
"
clear content
"
,
2
,
function
()
{
var
c0r0
=
buildSelector
(
0
,
0
,
0
);
var
c1r1
=
buildSelector
(
0
,
1
,
1
);
g
.
declareIframedGadget
(
gadgetURL
,
jqs
_context
)
g
.
declareIframedGadget
(
jqsGadgetURL
,
gadget
_context
)
.
then
(
function
(
gadget
)
{
iframeSelector
(
c0r0
).
html
(
'
c0r0Value
'
);
iframeSelector
(
c1r1
).
html
(
'
c1r1Value
'
);
...
...
@@ -76,7 +72,7 @@ QUnit.config.testTimeout = 1000;
var
c0r0
=
buildSelector
(
0
,
0
,
0
);
var
c1r1
=
buildSelector
(
0
,
1
,
1
);
g
.
declareIframedGadget
(
gadgetURL
,
jqs
_context
)
g
.
declareIframedGadget
(
jqsGadgetURL
,
gadget
_context
)
.
then
(
function
(
gadget
)
{
iframeSelector
(
c0r0
).
html
(
'
c0r0Value
'
);
iframeSelector
(
c1r1
).
html
(
'
c1r1Value
'
);
...
...
@@ -92,15 +88,14 @@ QUnit.config.testTimeout = 1000;
.
always
(
start
);
});
asyncTest
(
"
set content of sheet
"
,
function
()
{
expect
(
4
);
asyncTest
(
"
set content of sheet
"
,
4
,
function
()
{
var
gadget
,
content
,
t0c0r0
=
buildSelector
(
0
,
0
,
0
),
t0c1r1
=
buildSelector
(
0
,
1
,
1
),
t2c0r0
=
buildSelector
(
2
,
0
,
0
),
t2c1r1
=
buildSelector
(
2
,
1
,
1
);
g
.
declareIframedGadget
(
gadgetURL
,
jqs
_context
)
g
.
declareIframedGadget
(
jqsGadgetURL
,
gadget
_context
)
.
then
(
function
(
gd
)
{
iframeSelector
(
t0c0r0
).
html
(
'
c0r0Value
'
);
iframeSelector
(
t0c1r1
).
html
(
'
c1r1Value
'
);
...
...
@@ -122,6 +117,7 @@ QUnit.config.testTimeout = 1000;
})
.
always
(
start
);
});
});
}
(
window
,
jQuery
,
QUnit
,
rJS
));
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