Commit 84322694 by Miles Steele

add jasmine test for scroll to top

parent 83d12cd7
...@@ -134,6 +134,7 @@ xdescribe 'Sequence', -> ...@@ -134,6 +134,7 @@ xdescribe 'Sequence', ->
beforeEach -> beforeEach ->
jasmine.stubRequests() jasmine.stubRequests()
@sequence = new Sequence '1', 'sequence_1', @items, 'sequence', 2 @sequence = new Sequence '1', 'sequence_1', @items, 'sequence', 2
$.scrollTo 150
$('.sequence-nav-buttons .next a').click() $('.sequence-nav-buttons .next a').click()
it 'log the next sequence event', -> it 'log the next sequence event', ->
...@@ -142,10 +143,14 @@ xdescribe 'Sequence', -> ...@@ -142,10 +143,14 @@ xdescribe 'Sequence', ->
it 'call render on the next sequence', -> it 'call render on the next sequence', ->
expect($('#seq_content').html()).toEqual 'Sample Problem' expect($('#seq_content').html()).toEqual 'Sample Problem'
it 'scrolls to the top of the page', ->
expect($('body').scrollTop()).toBe 0
describe 'previous', -> describe 'previous', ->
beforeEach -> beforeEach ->
jasmine.stubRequests() jasmine.stubRequests()
@sequence = new Sequence '1', 'sequence_1', @items, 'sequence', 2 @sequence = new Sequence '1', 'sequence_1', @items, 'sequence', 2
$.scrollTo 150
$('.sequence-nav-buttons .prev a').click() $('.sequence-nav-buttons .prev a').click()
it 'log the previous sequence event', -> it 'log the previous sequence event', ->
...@@ -154,6 +159,9 @@ xdescribe 'Sequence', -> ...@@ -154,6 +159,9 @@ xdescribe 'Sequence', ->
it 'call render on the previous sequence', -> it 'call render on the previous sequence', ->
expect($('#seq_content').html()).toEqual 'Video 1' expect($('#seq_content').html()).toEqual 'Video 1'
it 'scrolls to the top of the page', ->
expect($('body').scrollTop()).toBe 0
describe 'link_for', -> describe 'link_for', ->
it 'return a link for specific position', -> it 'return a link for specific position', ->
sequence = new Sequence '1', 'sequence_1', @items, 2 sequence = new Sequence '1', 'sequence_1', @items, 2
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment