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
b6e82afb
Commit
b6e82afb
authored
Mar 18, 2013
by
Jay Zoldak
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1681 from MITx/fix/will/fix_broken_jasmine_lms_tests
Fix/will/fix broken jasmine lms tests
parents
eff6f1d1
9d8c023a
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
37 additions
and
29 deletions
+37
-29
cms/static/coffee/files.json
+9
-9
common/templates/jasmine/base.html
+8
-3
lms/static/coffee/files.json
+0
-3
lms/static/coffee/spec/calculator_spec.coffee
+12
-8
lms/static/coffee/spec/modules/tab_spec.coffee
+8
-3
lms/static/coffee/spec/navigation_spec.coffee
+0
-3
No files found.
cms/static/coffee/files.json
View file @
b6e82afb
{
"
js
_files"
:
[
"
/static/
js/vendor/RequireJS.js"
,
"
/static/
js/vendor/jquery.min.js"
,
"
/static/
js/vendor/jquery-ui.min.js"
,
"
/static/
js/vendor/jquery.ui.draggable.js"
,
"
/static/
js/vendor/jquery.cookie.js"
,
"
/static/
js/vendor/json2.js"
,
"
/static/
js/vendor/underscore-min.js"
,
"
/static/
js/vendor/backbone-min.js"
"
static
_files"
:
[
"js/vendor/RequireJS.js"
,
"js/vendor/jquery.min.js"
,
"js/vendor/jquery-ui.min.js"
,
"js/vendor/jquery.ui.draggable.js"
,
"js/vendor/jquery.cookie.js"
,
"js/vendor/json2.js"
,
"js/vendor/underscore-min.js"
,
"js/vendor/backbone-min.js"
]
}
common/templates/jasmine/base.html
View file @
b6e82afb
...
...
@@ -13,14 +13,19 @@
<script
src=
"{% static 'js/vendor/jasmine-jquery.js' %}"
></script>
<script
src=
"{% static 'console-runner.js' %}"
></script>
{% load compressed %}
{# static files #}
{% for url in suite.static_files %}
<script
src=
"{{ STATIC_URL }}{{ url }}"
></script>
{% endfor %}
{% compressed_js 'js-test-source' %}
{# source files #}
{% for url in suite.js_files %}
<script
src=
"{{ url }}"
></script>
{% endfor %}
{% load compressed %}
{# static files #}
{% compressed_js 'js-test-source' %}
{# spec files #}
{% compressed_js 'spec' %}
...
...
lms/static/coffee/files.json
View file @
b6e82afb
...
...
@@ -5,8 +5,5 @@
"/static/js/vendor/jquery-ui.min.js"
,
"/static/js/vendor/jquery.leanModal.min.js"
,
"/static/js/vendor/flot/jquery.flot.js"
],
"static_files"
:
[
"js/application.js"
]
}
lms/static/coffee/spec/calculator_spec.coffee
View file @
b6e82afb
...
...
@@ -4,9 +4,6 @@ describe 'Calculator', ->
@
calculator
=
new
Calculator
describe
'bind'
,
->
beforeEach
->
Calculator
.
bind
()
it
'bind the calculator button'
,
->
expect
(
$
(
'.calc'
)).
toHandleWith
'click'
,
@
calculator
.
toggle
...
...
@@ -31,12 +28,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"
))
...
...
lms/static/coffee/spec/modules/tab_spec.coffee
View file @
b6e82afb
...
...
@@ -22,18 +22,23 @@ describe 'Tab', ->
it
'bind the tabs'
,
->
expect
(
$
.
fn
.
tabs
).
toHaveBeenCalledWith
show
:
@
tab
.
onShow
# As of jQuery 1.9, the onShow callback is deprecated
# http://jqueryui.com/upgrade-guide/1.9/#deprecated-show-event-renamed-to-activate
# The code below tests that onShow does what is expected,
# but note that onShow will NOT be called when the user
# clicks on the tab if we're using jQuery version >= 1.9
describe
'onShow'
,
->
beforeEach
->
@
tab
=
new
Tab
1
,
@
items
$
(
'[href="#tab-1-0"]'
).
click
(
)
@
tab
.
onShow
(
$
(
'#tab-1-0'
),
{
'index'
:
1
}
)
it
'replace content in the container'
,
->
$
(
'[href="#tab-1-1"]'
).
click
(
)
@
tab
.
onShow
(
$
(
'#tab-1-1'
),
{
'index'
:
1
}
)
expect
(
$
(
'#tab-1-0'
).
html
()).
toEqual
''
expect
(
$
(
'#tab-1-1'
).
html
()).
toEqual
'Video 2'
expect
(
$
(
'#tab-1-2'
).
html
()).
toEqual
''
it
'trigger contentChanged event on the element'
,
->
spyOnEvent
@
tab
.
el
,
'contentChanged'
$
(
'[href="#tab-1-1"]'
).
click
(
)
@
tab
.
onShow
(
$
(
'#tab-1-1'
),
{
'index'
:
1
}
)
expect
(
'contentChanged'
).
toHaveBeenTriggeredOn
@
tab
.
el
lms/static/coffee/spec/navigation_spec.coffee
View file @
b6e82afb
...
...
@@ -32,11 +32,9 @@ describe 'Navigation', ->
heightStyle
:
'content'
it
'binds the accordionchange event'
,
->
Navigation
.
bind
()
expect
(
$
(
'#accordion'
)).
toHandleWith
'accordionchange'
,
@
navigation
.
log
it
'bind the navigation toggle'
,
->
Navigation
.
bind
()
expect
(
$
(
'#open_close_accordion a'
)).
toHandleWith
'click'
,
@
navigation
.
toggle
describe
'when the #accordion does not exists'
,
->
...
...
@@ -45,7 +43,6 @@ describe 'Navigation', ->
it
'does not activate the accordion'
,
->
spyOn
$
.
fn
,
'accordion'
Navigation
.
bind
()
expect
(
$
(
'#accordion'
).
accordion
).
wasNotCalled
()
describe
'toggle'
,
->
...
...
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