Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
todomvc
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
Eugene Shen
todomvc
Commits
ee537451
Commit
ee537451
authored
Aug 23, 2012
by
asudoh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed test files from dojo18 branch.
parent
bf4f1975
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
0 additions
and
366 deletions
+0
-366
architecture-examples/dojo/js/todo/tests/app18.html
architecture-examples/dojo/js/todo/tests/app18.html
+0
-209
architecture-examples/dojo/js/todo/tests/ctrl/TodoListRefController.js
...examples/dojo/js/todo/tests/ctrl/TodoListRefController.js
+0
-56
architecture-examples/dojo/js/todo/tests/dojoConfig.js
architecture-examples/dojo/js/todo/tests/dojoConfig.js
+0
-7
architecture-examples/dojo/js/todo/tests/model/SimpleTodoModel.js
...ture-examples/dojo/js/todo/tests/model/SimpleTodoModel.js
+0
-36
architecture-examples/dojo/js/todo/tests/module.js
architecture-examples/dojo/js/todo/tests/module.js
+0
-8
architecture-examples/dojo/js/todo/tests/runTests.html
architecture-examples/dojo/js/todo/tests/runTests.html
+0
-50
No files found.
architecture-examples/dojo/js/todo/tests/app18.html
deleted
100644 → 0
View file @
bf4f1975
<!doctype html>
<!--
This is a test runner for Dojo version of TodoMVC.
To use this, place todomvc directory at the directory containing dojo/dijit/dojox.
-->
<html
lang=
"en"
>
<head>
<meta
charset=
"utf-8"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge,chrome=1"
>
<title>
Dojo • TodoMVC
</title>
<link
rel=
"stylesheet"
href=
"../../../../../assets/base.css"
>
<!-- CSS overrides - remove if you don't need it -->
<link
rel=
"stylesheet"
href=
"../../../css/app.css"
>
<!--[if IE]>
<script>
nativeDate = Date;
</script>
<script src="../../../../../assets/ie.js"></script>
<script>
(function(nativeDate){
// It appears that the modification to Date constructor done by ie.js negatively affects new Date("X"), ending up a JS error.
// Using the native Date constructor for that case.
var origDate = Date;
Date = function(){
return (arguments.length == 1 && typeof arguments[0] == "string" ? nativeDate : origDate).apply(this, [].slice.call(arguments, 0));
};
Date.prototype = new origDate();
})(nativeDate);
</script>
<![endif]-->
</head>
<body>
<section
id=
"todoapp"
data-dojo-type=
"todo/app18"
></section>
<footer
id=
"info"
>
<p>
Double-click to edit a todo
</p>
<p>
Created by
<a
href=
"http://jamesthom.as/"
>
James Thomas
</a>
and
<a
href=
"https://github.com/edchat"
>
Ed Chatelain
</a></p>
</footer>
<script
src=
"../../../../../assets/base.js"
></script>
<script>
require
=
{
async
:
true
,
parseOnLoad
:
false
,
locale
:
"
en
"
,
paths
:
{
"
todo
"
:
"
../todomvc/architecture-examples/dojo/js/todo
"
},
deps
:
[
"
doh
"
,
"
dojo/dom-style
"
,
"
dojo/json
"
,
"
dojo/keys
"
,
"
dojo/on
"
,
"
dojo/parser
"
,
"
dojo/query
"
,
"
dojo/when
"
,
"
dojo/domReady!
"
],
mvc
:
{
debugBindings
:
true
},
callback
:
function
(
doh
,
domStyle
,
json
,
keys
,
on
,
parser
,
query
,
when
){
var
id
=
"
todos-dojo
"
;
localStorage
.
removeItem
(
id
);
localStorage
.
setItem
(
id
,
json
.
stringify
({
id
:
"
todos-dojo
"
,
todos
:
[
{
title
:
"
Task0
"
,
completed
:
false
},
{
title
:
"
Task1
"
,
completed
:
true
},
{
title
:
"
Task2
"
,
completed
:
false
}
],
incomplete
:
2
,
complete
:
1
}));
when
(
parser
.
parse
(),
function
(){
doh
.
register
(
"
todo.app18
"
,
[
function
initialState
(){
doh
.
f
(
query
(
"
#toggle-all
"
)[
0
].
checked
,
"
The check box to mark all todo items complete/incomplete should be unchecked
"
);
var
complete
=
0
,
incomplete
=
0
;
query
(
"
#todo-list input[type=checkbox]
"
).
forEach
(
function
(
node
){
complete
+=
!!
node
.
checked
;
incomplete
+=
!
node
.
checked
;
});
doh
.
is
(
1
,
complete
,
"
Count of completed todo items should be 1
"
);
doh
.
is
(
2
,
incomplete
,
"
Count of incomplete todo items should be 2
"
);
doh
.
t
(
/^
\s
*2
\s
*$/
.
test
(
query
(
"
#todo-count strong span.number
"
)[
0
].
innerHTML
),
"
Count of incomplete todo items should be shown as 2 in the UI
"
);
doh
.
f
(
/^none$/i
.
test
(
domStyle
.
getComputedStyle
(
query
(
"
#todo-count span.word span
"
)[
0
]).
display
),
"
's' in
\"
items
\"
should be shown
"
);
doh
.
f
(
/^none$/i
.
test
(
domStyle
.
getComputedStyle
(
query
(
"
#clear-completed
"
)[
0
]).
display
),
"
Clear completed button should be shown
"
);
doh
.
t
(
/^
\s
*1
\s
*$/
.
test
(
query
(
"
#clear-completed span.number-done
"
)[
0
].
innerHTML
),
"
Count of completed todo items should be shown as 1 in the UI
"
);
},
function
markItemComplete
(){
query
(
"
#todo-list input[type=checkbox]
"
)[
0
].
click
();
doh
.
f
(
query
(
"
#toggle-all
"
)[
0
].
checked
,
"
The check box to mark all todo items complete/incomplete should be unchecked
"
);
var
complete
=
0
,
incomplete
=
0
;
query
(
"
#todo-list input[type=checkbox]
"
).
forEach
(
function
(
node
){
complete
+=
!!
node
.
checked
;
incomplete
+=
!
node
.
checked
;
});
doh
.
is
(
2
,
complete
,
"
Count of completed todo items should be 2
"
);
doh
.
is
(
1
,
incomplete
,
"
Count of incomplete todo items should be 1
"
);
doh
.
t
(
/^
\s
*1
\s
*$/
.
test
(
query
(
"
#todo-count strong span.number
"
)[
0
].
innerHTML
),
"
Count of incomplete todo items should be shown as 1 in the UI
"
);
doh
.
t
(
/^none$/i
.
test
(
domStyle
.
getComputedStyle
(
query
(
"
#todo-count span.word span
"
)[
0
]).
display
),
"
's' in
\"
items
\"
should be hidden
"
);
doh
.
f
(
/^none$/i
.
test
(
domStyle
.
getComputedStyle
(
query
(
"
#clear-completed
"
)[
0
]).
display
),
"
Clear completed button should be shown
"
);
doh
.
t
(
/^
\s
*2
\s
*$/
.
test
(
query
(
"
#clear-completed span.number-done
"
)[
0
].
innerHTML
),
"
Count of completed todo items should be shown as 2 in the UI
"
);
},
function
markItemIncomplete
(){
query
(
"
#todo-list input[type=checkbox]
"
)[
1
].
click
();
doh
.
f
(
query
(
"
#toggle-all
"
)[
0
].
checked
,
"
The check box to mark all todo items complete/incomplete should be unchecked
"
);
var
complete
=
0
,
incomplete
=
0
;
query
(
"
#todo-list input[type=checkbox]
"
).
forEach
(
function
(
node
){
complete
+=
!!
node
.
checked
;
incomplete
+=
!
node
.
checked
;
});
doh
.
is
(
1
,
complete
,
"
Count of completed todo items should be 1
"
);
doh
.
is
(
2
,
incomplete
,
"
Count of incomplete todo items should be 2
"
);
doh
.
t
(
/^
\s
*2
\s
*$/
.
test
(
query
(
"
#todo-count strong span.number
"
)[
0
].
innerHTML
),
"
Count of incomplete todo items should be shown as 2 in the UI
"
);
doh
.
f
(
/^none$/i
.
test
(
domStyle
.
getComputedStyle
(
query
(
"
#todo-count span.word span
"
)[
0
]).
display
),
"
's' in
\"
items
\"
should be shown
"
);
doh
.
f
(
/^none$/i
.
test
(
domStyle
.
getComputedStyle
(
query
(
"
#clear-completed
"
)[
0
]).
display
),
"
Clear completed button should be shown
"
);
doh
.
t
(
/^
\s
*1
\s
*$/
.
test
(
query
(
"
#clear-completed span.number-done
"
)[
0
].
innerHTML
),
"
Count of completed todo items should be shown as 1 in the UI
"
);
},
function
clearCompleted
(){
query
(
"
#clear-completed
"
)[
0
].
click
();
doh
.
f
(
query
(
"
#toggle-all
"
)[
0
].
checked
,
"
The check box to mark all todo items complete/incomplete should be unchecked
"
);
var
complete
=
0
,
incomplete
=
0
;
query
(
"
#todo-list input[type=checkbox]
"
).
forEach
(
function
(
node
){
complete
+=
!!
node
.
checked
;
incomplete
+=
!
node
.
checked
;
});
doh
.
is
(
0
,
complete
,
"
Count of completed todo items should be 0
"
);
doh
.
is
(
2
,
incomplete
,
"
Count of incomplete todo items should be 2
"
);
doh
.
t
(
/^
\s
*2
\s
*$/
.
test
(
query
(
"
#todo-count strong span.number
"
)[
0
].
innerHTML
),
"
Count of incomplete todo items should be shown as 2 in the UI
"
);
doh
.
f
(
/^none$/i
.
test
(
domStyle
.
getComputedStyle
(
query
(
"
#todo-count span.word span
"
)[
0
]).
display
),
"
's' in
\"
items
\"
should be shown
"
);
doh
.
t
(
/^none$/i
.
test
(
domStyle
.
getComputedStyle
(
query
(
"
#clear-completed
"
)[
0
]).
display
),
"
Clear completed button should be hidden
"
);
doh
.
t
(
/^
\s
*0
\s
*$/
.
test
(
query
(
"
#clear-completed span.number-done
"
)[
0
].
innerHTML
),
"
Count of completed todo items should be shown as 0 in the UI
"
);
},
function
markAllComplete
(){
query
(
"
#toggle-all
"
)[
0
].
click
();
doh
.
t
(
query
(
"
#toggle-all
"
)[
0
].
checked
,
"
The check box to mark all todo items complete/incomplete should be checked
"
);
var
complete
=
0
,
incomplete
=
0
;
query
(
"
#todo-list input[type=checkbox]
"
).
forEach
(
function
(
node
){
complete
+=
!!
node
.
checked
;
incomplete
+=
!
node
.
checked
;
});
doh
.
is
(
2
,
complete
,
"
Count of completed todo items should be 2
"
);
doh
.
is
(
0
,
incomplete
,
"
Count of incomplete todo items should be 0
"
);
doh
.
t
(
/^
\s
*0
\s
*$/
.
test
(
query
(
"
#todo-count strong span.number
"
)[
0
].
innerHTML
),
"
Count of incomplete todo items should be shown as 0 in the UI
"
);
doh
.
t
(
/^none$/i
.
test
(
domStyle
.
getComputedStyle
(
query
(
"
#todo-count span.word span
"
)[
0
]).
display
),
"
's' in
\"
items
\"
should be hidden
"
);
doh
.
f
(
/^none$/i
.
test
(
domStyle
.
getComputedStyle
(
query
(
"
#clear-completed
"
)[
0
]).
display
),
"
Clear completed button should be shown
"
);
doh
.
t
(
/^
\s
*2
\s
*$/
.
test
(
query
(
"
#clear-completed span.number-done
"
)[
0
].
innerHTML
),
"
Count of completed todo items should be shown as 2 in the UI
"
);
},
function
markAllInComplete
(){
query
(
"
#toggle-all
"
)[
0
].
click
();
doh
.
f
(
query
(
"
#toggle-all
"
)[
0
].
checked
,
"
The check box to mark all todo items complete/incomplete should be unchecked
"
);
var
complete
=
0
,
incomplete
=
0
;
query
(
"
#todo-list input[type=checkbox]
"
).
forEach
(
function
(
node
){
complete
+=
!!
node
.
checked
;
incomplete
+=
!
node
.
checked
;
});
doh
.
is
(
0
,
complete
,
"
Count of completed todo items should be 0
"
);
doh
.
is
(
2
,
incomplete
,
"
Count of incomplete todo items should be 2
"
);
doh
.
t
(
/^
\s
*2
\s
*$/
.
test
(
query
(
"
#todo-count strong span.number
"
)[
0
].
innerHTML
),
"
Count of incomplete todo items should be shown as 2 in the UI
"
);
doh
.
f
(
/^none$/i
.
test
(
domStyle
.
getComputedStyle
(
query
(
"
#todo-count span.word span
"
)[
0
]).
display
),
"
's' in
\"
items
\"
should be shown
"
);
doh
.
t
(
/^none$/i
.
test
(
domStyle
.
getComputedStyle
(
query
(
"
#clear-completed
"
)[
0
]).
display
),
"
Clear completed button should be hidden
"
);
doh
.
t
(
/^
\s
*0
\s
*$/
.
test
(
query
(
"
#clear-completed span.number-done
"
)[
0
].
innerHTML
),
"
Count of completed todo items should be shown as 0 in the UI
"
);
},
function
removeItem
(){
query
(
"
button.destroy
"
)[
1
].
click
();
doh
.
f
(
query
(
"
#toggle-all
"
)[
0
].
checked
,
"
The check box to mark all todo items complete/incomplete should be unchecked
"
);
var
complete
=
0
,
incomplete
=
0
;
query
(
"
#todo-list input[type=checkbox]
"
).
forEach
(
function
(
node
){
complete
+=
!!
node
.
checked
;
incomplete
+=
!
node
.
checked
;
});
doh
.
is
(
0
,
complete
,
"
Count of completed todo items should be 0
"
);
doh
.
is
(
1
,
incomplete
,
"
Count of incomplete todo items should be 1
"
);
doh
.
t
(
/^
\s
*1
\s
*$/
.
test
(
query
(
"
#todo-count strong span.number
"
)[
0
].
innerHTML
),
"
Count of incomplete todo items should be shown as 1 in the UI
"
);
doh
.
t
(
/^none$/i
.
test
(
domStyle
.
getComputedStyle
(
query
(
"
#todo-count span.word span
"
)[
0
]).
display
),
"
's' in
\"
items
\"
should be hidden
"
);
doh
.
t
(
/^none$/i
.
test
(
domStyle
.
getComputedStyle
(
query
(
"
#clear-completed
"
)[
0
]).
display
),
"
Clear completed button should be hidden
"
);
doh
.
t
(
/^
\s
*0
\s
*$/
.
test
(
query
(
"
#clear-completed span.number-done
"
)[
0
].
innerHTML
),
"
Count of completed todo items should be shown as 0 in the UI
"
);
},
function
markItemComplete
(){
query
(
"
#todo-list input[type=checkbox]
"
)[
0
].
click
();
doh
.
t
(
query
(
"
#toggle-all
"
)[
0
].
checked
,
"
The check box to mark all todo items complete/incomplete should be checked
"
);
var
complete
=
0
,
incomplete
=
0
;
query
(
"
#todo-list input[type=checkbox]
"
).
forEach
(
function
(
node
){
complete
+=
!!
node
.
checked
;
incomplete
+=
!
node
.
checked
;
});
doh
.
is
(
1
,
complete
,
"
Count of completed todo items should be 1
"
);
doh
.
is
(
0
,
incomplete
,
"
Count of incomplete todo items should be 0
"
);
doh
.
t
(
/^
\s
*0
\s
*$/
.
test
(
query
(
"
#todo-count strong span.number
"
)[
0
].
innerHTML
),
"
Count of incomplete todo items should be shown as 0 in the UI
"
);
doh
.
t
(
/^none$/i
.
test
(
domStyle
.
getComputedStyle
(
query
(
"
#todo-count span.word span
"
)[
0
]).
display
),
"
's' in
\"
items
\"
should be hidden
"
);
doh
.
f
(
/^none$/i
.
test
(
domStyle
.
getComputedStyle
(
query
(
"
#clear-completed
"
)[
0
]).
display
),
"
Clear completed button should be shown
"
);
doh
.
t
(
/^
\s
*1
\s
*$/
.
test
(
query
(
"
#clear-completed span.number-done
"
)[
0
].
innerHTML
),
"
Count of completed todo items should be shown as 1 in the UI
"
);
},
function
addItem
(){
query
(
"
#new-todo
"
)[
0
].
value
=
"
Task3
"
;
on
.
emit
(
query
(
"
#new-todo
"
)[
0
],
"
keypress
"
,
{
keyCode
:
keys
.
ENTER
});
var
complete
=
0
,
incomplete
=
0
;
query
(
"
#todo-list input[type=checkbox]
"
).
forEach
(
function
(
node
){
complete
+=
!!
node
.
checked
;
incomplete
+=
!
node
.
checked
;
});
doh
.
is
(
1
,
complete
,
"
Count of completed todo items should be 1
"
);
doh
.
is
(
1
,
incomplete
,
"
Count of incomplete todo items should be 1
"
);
doh
.
t
(
/^
\s
*1
\s
*$/
.
test
(
query
(
"
#todo-count strong span.number
"
)[
0
].
innerHTML
),
"
Count of incomplete todo items should be shown as 1 in the UI
"
);
doh
.
t
(
/^none$/i
.
test
(
domStyle
.
getComputedStyle
(
query
(
"
#todo-count span.word span
"
)[
0
]).
display
),
"
's' in
\"
items
\"
should be hidden
"
);
doh
.
f
(
/^none$/i
.
test
(
domStyle
.
getComputedStyle
(
query
(
"
#clear-completed
"
)[
0
]).
display
),
"
Clear completed button should be shown
"
);
doh
.
t
(
/^
\s
*1
\s
*$/
.
test
(
query
(
"
#clear-completed span.number-done
"
)[
0
].
innerHTML
),
"
Count of completed todo items should be shown as 1 in the UI
"
);
}
]);
doh
.
run
();
});
}
};
</script>
<script
src=
"../../../../../../dojo/dojo.js"
></script>
</body>
</html>
architecture-examples/dojo/js/todo/tests/ctrl/TodoListRefController.js
deleted
100644 → 0
View file @
bf4f1975
define
([
"
doh
"
,
"
dojo/json
"
,
"
dojox/mvc/at
"
,
"
../../ctrl/TodoListRefController
"
,
"
../../ctrl/TodoRefController
"
,
"
../../model/SimpleTodoModel
"
,
"
../../store/LocalStorage
"
],
function
(
doh
,
json
,
at
,
TodoListRefController
,
TodoRefController
,
SimpleTodoModel
,
LocalStorage
){
doh
.
register
(
"
todo.tests.ctrl.TodoListRefController
"
,
[
function
empty
(){
localStorage
.
removeItem
(
"
todos-dojo
"
);
var
ctrl
=
new
TodoRefController
({
defaultId
:
"
todos-dojo
"
,
modelClass
:
SimpleTodoModel
,
store
:
new
LocalStorage
()
}),
listCtrl
=
new
TodoListRefController
({
model
:
at
(
ctrl
,
"
todos
"
)
});
doh
.
is
(
0
,
ctrl
.
get
(
"
complete
"
),
"
The current count of completed todo items should be 0
"
);
doh
.
is
(
0
,
ctrl
.
get
(
"
incomplete
"
),
"
The current count of incomplete todo items should be 0
"
);
doh
.
is
(
0
,
listCtrl
.
get
(
"
length
"
),
"
The current length should be 0
"
);
listCtrl
.
model
.
push
({
title
:
"
Task0
"
,
completed
:
false
});
doh
.
is
(
0
,
ctrl
.
get
(
"
complete
"
),
"
The current count of completed todo items should be 0
"
);
doh
.
is
(
1
,
ctrl
.
get
(
"
incomplete
"
),
"
The current count of incomplete todo items should be 1
"
);
doh
.
is
(
1
,
listCtrl
.
get
(
"
length
"
),
"
The current length should be 1
"
);
},
function
existing
(){
localStorage
.
setItem
(
"
todos-dojo
"
,
json
.
stringify
({
id
:
"
todos-dojo
"
,
todos
:
[
{
title
:
"
Task0
"
,
completed
:
false
},
{
title
:
"
Task1
"
,
completed
:
true
},
{
title
:
"
Task2
"
,
completed
:
false
}
],
incomplete
:
2
,
complete
:
1
}));
var
ctrl
=
new
TodoRefController
({
defaultId
:
"
todos-dojo
"
,
modelClass
:
SimpleTodoModel
,
store
:
new
LocalStorage
()
}),
listCtrl
=
new
TodoListRefController
({
model
:
at
(
ctrl
,
"
todos
"
)
});
doh
.
is
(
1
,
ctrl
.
get
(
"
complete
"
),
"
The current count of completed todo items should be 1
"
);
doh
.
is
(
2
,
ctrl
.
get
(
"
incomplete
"
),
"
The current count of incomplete todo items should be 2
"
);
doh
.
is
(
3
,
listCtrl
.
get
(
"
length
"
),
"
The current length should be 3
"
);
}
]);
});
\ No newline at end of file
architecture-examples/dojo/js/todo/tests/dojoConfig.js
deleted
100644 → 0
View file @
bf4f1975
(
function
(
require
){
require
.
baseUrl
=
"
../../dojo
"
;
require
.
packages
=
(
require
.
packages
||
[]).
concat
([{
name
:
"
todo
"
,
location
:
"
../todomvc/architecture-examples/dojo/js/todo
"
}]);
})(
require
);
architecture-examples/dojo/js/todo/tests/model/SimpleTodoModel.js
deleted
100644 → 0
View file @
bf4f1975
define
([
"
doh
"
,
"
dojo/Stateful
"
,
"
../../model/SimpleTodoModel
"
],
function
(
doh
,
Stateful
,
SimpleTodoModel
){
doh
.
register
(
"
todo.tests.model.SimpleTodoModel
"
,
[
function
basic
(){
var
model
=
new
SimpleTodoModel
({
id
:
"
todos-dojo
"
,
todos
:
[
{
title
:
"
Task0
"
,
completed
:
false
},
{
title
:
"
Task1
"
,
completed
:
true
},
{
title
:
"
Task2
"
,
completed
:
false
}
],
incomplete
:
2
,
complete
:
1
});
model
.
todos
.
push
(
new
Stateful
({
title
:
"
Task3
"
,
completed
:
true
}),
new
Stateful
({
title
:
"
Task4
"
,
completed
:
false
}));
doh
.
is
(
2
,
model
.
complete
,
"
We should have two complete tasks
"
);
doh
.
is
(
3
,
model
.
incomplete
,
"
We should have three incomplete tasks
"
);
model
.
todos
.
push
(
new
Stateful
({
title
:
"
Task5
"
,
completed
:
false
}));
doh
.
is
(
2
,
model
.
complete
,
"
We should have two complete tasks
"
);
doh
.
is
(
4
,
model
.
incomplete
,
"
We should have four incomplete tasks
"
);
model
.
todos
[
4
].
set
(
"
completed
"
,
true
);
doh
.
is
(
3
,
model
.
complete
,
"
We should have three complete tasks
"
);
doh
.
is
(
3
,
model
.
incomplete
,
"
We should have three incomplete tasks
"
);
model
.
todos
.
splice
(
4
,
1
);
doh
.
is
(
2
,
model
.
complete
,
"
We should have two complete tasks
"
);
doh
.
is
(
3
,
model
.
incomplete
,
"
We should have three incomplete tasks
"
);
}
]);
});
\ No newline at end of file
architecture-examples/dojo/js/todo/tests/module.js
deleted
100644 → 0
View file @
bf4f1975
define
([
"
doh
"
,
"
./ctrl/TodoListRefController
"
,
"
./model/SimpleTodoModel
"
],
function
(
doh
){
var
userArgs
=
window
.
location
.
search
.
replace
(
/
[\?
&
](
dojoUrl|testUrl|testModule
)
=
[^
&
]
*/g
,
""
).
replace
(
/^&/
,
"
?
"
);
doh
.
registerUrl
(
"
todo.tests.app18
"
,
require
.
toUrl
(
"
todo/tests/app18.html
"
)
+
userArgs
,
999999
);
});
architecture-examples/dojo/js/todo/tests/runTests.html
deleted
100644 → 0
View file @
bf4f1975
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!--
This is a test runner for Dojo version of TodoMVC.
To use this, place todomvc directory at the directory containing dojo/dijit/dojox.
-->
<html>
<head>
<title>
Unit Test Runner
</title>
<script>
function
onLoadHandler
(){
var
queryString
=
window
.
location
.
search
.
substr
(
1
),
queries
=
queryString
.
split
(
"
&
"
),
moduleFound
=
false
;
for
(
var
i
=
0
;
i
<
queries
.
length
;
i
++
){
if
(
/^test
(
|Url|Module
)
=/i
.
test
(
queries
[
i
])){
moduleFound
=
true
;
break
;
}
}
if
(
!
moduleFound
){
queryString
+=
(
queryString
?
"
&
"
:
""
)
+
"
test=todo/tests/module&async=true
"
;
}
document
.
getElementById
(
"
testFrame
"
).
src
=
"
../../../../../../util/doh/runner.html?boot=../../todomvc/architecture-examples/dojo/js/todo/tests/dojoConfig.js
"
+
(
queryString
?
(
"
&
"
+
queryString
)
:
""
);
}
function
iFrameOnLoadHandler
(){
// summary:
// Makes sure todo/tests/dojoConfig.js is loaded before dojo.js is loaded.
// DOH's &boot URL arg handler does not allow us to specify what order the modules are loaded.
var
w
=
document
.
getElementById
(
"
testFrame
"
).
contentWindow
,
found
=
false
;
for
(
var
packs
=
(
w
.
require
||
{}).
packages
,
i
=
0
;
packs
&&
i
<
packs
.
length
;
i
++
){
if
(
packs
[
i
].
name
==
"
todo
"
){
found
=
true
;
break
;
}
}
if
(
!
found
){
return
setTimeout
(
iFrameOnLoadHandler
,
500
);
}
var
script
=
document
.
createElement
(
"
script
"
);
script
.
type
=
"
text/javascript
"
;
script
.
src
=
"
../../../../../../dojo/dojo.js
"
;
script
.
charset
=
"
utf-8
"
;
w
.
document
.
getElementsByTagName
(
"
head
"
)[
0
].
appendChild
(
script
);
}
</script>
</head>
<body
onload=
"onLoadHandler();"
style=
"width:100%;height:100%;margin:0;padding:0;"
>
<iframe
id=
"testFrame"
onload=
"iFrameOnLoadHandler();"
frameborder=
"0"
style=
"width:100%;height:100%;margin:0;padding:0;"
></iframe>
</body>
</html>
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