Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
386029be
Commit
386029be
authored
Jun 30, 2013
by
Julian Arni
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding jasmine tests; code cleanup.
parent
b03d9390
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
81 additions
and
18 deletions
+81
-18
common/lib/capa/capa/templates/jsinput.html
+0
-0
common/lib/xmodule/xmodule/css/capa/display.scss
+9
-1
common/lib/xmodule/xmodule/js/src/capa/display.coffee
+1
-1
common/static/js/capa/jsinput.js
+0
-0
common/static/js/capa/spec/jsinput/jsinput.js
+71
-0
common/static/js/capa/spec/jsinput/mainfixture.html
+0
-0
common/static/js/test/jsinput/jsinput.js
+0
-16
No files found.
common/lib/capa/capa/templates/jsinput.html
View file @
386029be
common/lib/xmodule/xmodule/css/capa/display.scss
View file @
386029be
...
...
@@ -16,8 +16,16 @@ h2 {
}
}
iframe
[
seamless
]
{
background-color
:
transparent
;
border
:
0px
none
transparent
;
padding
:
0px
;
overflow
:
hidden
;
}
.inline-error
{
color
:
darken
(
$error-red
,
1
0
%
);
color
:
darken
(
$error-red
,
1
1
%
);
}
...
...
common/lib/xmodule/xmodule/js/src/capa/display.coffee
View file @
386029be
...
...
@@ -142,7 +142,7 @@ class @Problem
# off @answers
check_waitfor
:
=>
for
inp
in
@
inputs
if
(
$
(
inp
).
attr
(
"waitfor"
)
?
)
if
(
$
(
inp
).
is
(
"input[waitfor]"
)
)
try
$
(
inp
).
data
(
"waitfor"
)()
catch
e
...
...
common/static/js/capa/jsinput.js
View file @
386029be
This diff is collapsed.
Click to expand it.
common/static/js/capa/spec/jsinput/jsinput.js
0 → 100644
View file @
386029be
describe
(
"A jsinput has:"
,
function
()
{
beforeEach
(
function
()
{
$
(
'#fixture'
).
remove
();
$
.
ajax
({
async
:
false
,
url
:
'mainfixture.html'
,
success
:
function
(
data
)
{
$
(
'body'
).
append
(
$
(
data
));
}
});
});
describe
(
"The ctxCall function"
,
function
()
{
it
(
"Evaluatates nested-object functions"
,
function
()
{
var
ctxTest
=
{
ctxFn
:
function
()
{
return
this
.
name
;
}
};
var
fnString
=
"nest.ctxFn"
;
var
holder
=
{};
holder
.
nest
=
ctxTest
;
var
fn
=
_ctxCall
(
holder
,
fnString
);
expect
(
fnString
).
toBe
(
holder
.
nest
.
ctxFn
());
});
it
(
"Throws an exception when the object does not exits"
,
function
()
{
var
notObj
=
_ctxCall
(
"twas"
,
"brilling"
);
expect
(
notObj
).
toThrow
();
});
it
(
"Throws an exception when the function does not exist"
,
function
()
{
var
anobj
=
{};
var
notFn
=
_ctxCall
(
"anobj"
,
"brillig"
);
expect
(
notFn
).
toThrow
();
});
});
describe
(
"The jsinput constructor"
,
function
(){
var
testJsElem
=
jsinputConstructor
({
id
:
3781
,
elem
:
"<div id='abc'> a div </div>"
,
passive
:
false
});
it
(
"Returns an object"
,
function
(){
expect
(
typeof
(
testJsElem
)).
toEqual
(
'object'
);
});
it
(
"Adds the object to the jsinput array"
,
function
()
{
expect
(
jsinput
.
jsinputarr
.
exists
(
3781
)).
toBe
(
true
);
});
describe
(
"The returned object"
,
function
()
{
it
(
"Has a public 'update' method"
,
function
(){
expect
(
testJsElem
.
update
).
toBeDefined
();
});
it
(
"Changes the parent's inputfield"
,
function
()
{
})
});
});
}
)
common/static/js/
test
/jsinput/mainfixture.html
→
common/static/js/
capa/spec
/jsinput/mainfixture.html
View file @
386029be
File moved
common/static/js/test/jsinput/jsinput.js
deleted
100644 → 0
View file @
b03d9390
describe
(
"jsinput test"
,
function
()
{
beforeEach
(
function
()
{
$
(
'#fixture'
).
remove
();
$
.
ajax
({
async
:
false
,
url
:
'mainfixture.html'
,
success
:
function
(
data
)
{
$
(
'body'
).
append
(
$
(
data
));
}
});
});
it
(
""
)
}
)
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