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
a9623064
Commit
a9623064
authored
Oct 11, 2013
by
polesye
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix js unit tests.
parent
524388db
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
8 deletions
+12
-8
lms/static/coffee/spec/calculator_spec.coffee
+12
-8
No files found.
lms/static/coffee/spec/calculator_spec.coffee
View file @
a9623064
...
...
@@ -9,8 +9,10 @@ describe 'Calculator', ->
it
'bind the help button'
,
->
# These events are bind by $.hover()
expect
(
$
(
'div.help-wrapper a'
)).
toHandleWith
'mouseover'
,
@
calculator
.
helpToggle
expect
(
$
(
'div.help-wrapper a'
)).
toHandleWith
'mouseout'
,
@
calculator
.
helpToggle
expect
(
$
(
'div.help-wrapper a'
)).
toHandle
'mouseover'
expect
(
$
(
'div.help-wrapper a'
)).
toHandle
'mouseout'
expect
(
$
(
'div.help-wrapper'
)).
toHandle
'focusin'
expect
(
$
(
'div.help-wrapper'
)).
toHandle
'focusout'
it
'prevent default behavior on help button'
,
->
$
(
'div.help-wrapper a'
).
click
(
e
)
->
...
...
@@ -33,8 +35,8 @@ describe 'Calculator', ->
# Since the focus is called asynchronously, we need to
# wait until focus() is called.
didFocus
=
false
runs
->
spyOn
(
$
.
fn
,
'focus'
).
andCallFake
(
elementName
)
->
didFocus
=
true
runs
->
spyOn
(
$
.
fn
,
'focus'
).
andCallFake
(
elementName
)
->
didFocus
=
true
@
calculator
.
toggle
(
jQuery
.
Event
(
"click"
))
waitsFor
(
->
didFocus
),
"focus() should have been called on the input"
,
1000
...
...
@@ -49,12 +51,14 @@ describe 'Calculator', ->
@
calculator
.
toggle
(
jQuery
.
Event
(
"click"
))
expect
(
$
(
'.calc'
)).
not
.
toHaveClass
(
'closed'
)
describe
'help
Toggle
'
,
->
it
'
toggle
the help overlay'
,
->
@
calculator
.
help
Toggle
()
describe
'help
Show
'
,
->
it
'
show
the help overlay'
,
->
@
calculator
.
help
Show
()
expect
(
$
(
'.help'
)).
toHaveClass
(
'shown'
)
@
calculator
.
helpToggle
()
describe
'helpHide'
,
->
it
'show the help overlay'
,
->
@
calculator
.
helpHide
()
expect
(
$
(
'.help'
)).
not
.
toHaveClass
(
'shown'
)
describe
'calculate'
,
->
...
...
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