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
20b04c9b
Commit
20b04c9b
authored
Mar 06, 2013
by
Will Daly
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed broken calculator test in lms coffee scripts
parent
7806acc7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
5 deletions
+12
-5
lms/static/coffee/spec/calculator_spec.coffee
+12
-5
No files found.
lms/static/coffee/spec/calculator_spec.coffee
View file @
20b04c9b
...
...
@@ -31,12 +31,19 @@ describe 'Calculator', ->
$
(
'form#calculator'
).
submit
()
describe
'toggle'
,
->
it
'toggle the calculator and focus the input'
,
->
spyOn
$
.
fn
,
'focus'
@
calculator
.
toggle
(
jQuery
.
Event
(
"click"
))
it
'focuses the input when toggled'
,
->
# Since the focus is called asynchronously, we need to
# wait until focus() is called.
didFocus
=
false
runs
->
spyOn
(
$
.
fn
,
'focus'
).
andCallFake
(
elementName
)
->
didFocus
=
true
@
calculator
.
toggle
(
jQuery
.
Event
(
"click"
))
waitsFor
(
->
didFocus
),
"focus() should have been called on the input"
,
1000
expect
(
$
(
'li.calc-main'
)).
toHaveClass
(
'open'
)
expect
(
$
(
'#calculator_wrapper #calculator_input'
).
focus
).
toHaveBeenCalled
()
runs
->
expect
(
$
(
'#calculator_wrapper #calculator_input'
).
focus
).
toHaveBeenCalled
()
it
'toggle the close button on the calculator button'
,
->
@
calculator
.
toggle
(
jQuery
.
Event
(
"click"
))
...
...
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