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
a777a9e6
Commit
a777a9e6
authored
Mar 11, 2013
by
Will Daly
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated broken tabs.js Jasmine tests.
parent
6b94090e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
lms/static/coffee/spec/modules/tab_spec.coffee
+8
-3
No files found.
lms/static/coffee/spec/modules/tab_spec.coffee
View file @
a777a9e6
...
...
@@ -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
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