Commit d778f2e9 by Brian Talbot Committed by Giulio Gratta

updates jasmine tests to correspond to new capa template HTML

parent a377f860
...@@ -62,7 +62,7 @@ describe 'Problem', -> ...@@ -62,7 +62,7 @@ describe 'Problem', ->
expect($('section.action input.reset')).toHandleWith 'click', @problem.reset expect($('section.action input.reset')).toHandleWith 'click', @problem.reset
it 'bind the show button', -> it 'bind the show button', ->
expect($('section.action input.show')).toHandleWith 'click', @problem.show expect($('section.action button.show')).toHandleWith 'click', @problem.show
it 'bind the save button', -> it 'bind the save button', ->
expect($('section.action input.save')).toHandleWith 'click', @problem.save expect($('section.action input.save')).toHandleWith 'click', @problem.save
...@@ -198,7 +198,7 @@ describe 'Problem', -> ...@@ -198,7 +198,7 @@ describe 'Problem', ->
it 'toggle the show answer button', -> it 'toggle the show answer button', ->
spyOn($, 'postWithPrefix').andCallFake (url, callback) -> callback(answers: {}) spyOn($, 'postWithPrefix').andCallFake (url, callback) -> callback(answers: {})
@problem.show() @problem.show()
expect($('.show')).toHaveValue 'Hide Answer' expect($('.show .show-label')).toHaveText 'Hide Answer(s)'
it 'add the showed class to element', -> it 'add the showed class to element', ->
spyOn($, 'postWithPrefix').andCallFake (url, callback) -> callback(answers: {}) spyOn($, 'postWithPrefix').andCallFake (url, callback) -> callback(answers: {})
...@@ -223,7 +223,7 @@ describe 'Problem', -> ...@@ -223,7 +223,7 @@ describe 'Problem', ->
expect($('label[for="input_1_1_3"]')).toHaveAttr 'correct_answer', 'true' expect($('label[for="input_1_1_3"]')).toHaveAttr 'correct_answer', 'true'
expect($('label[for="input_1_2_1"]')).not.toHaveAttr 'correct_answer', 'true' expect($('label[for="input_1_2_1"]')).not.toHaveAttr 'correct_answer', 'true'
describe 'when the answers are alreay shown', -> describe 'when the answers are already shown', ->
beforeEach -> beforeEach ->
@problem.el.addClass 'showed' @problem.el.addClass 'showed'
@problem.el.prepend ''' @problem.el.prepend '''
...@@ -243,7 +243,7 @@ describe 'Problem', -> ...@@ -243,7 +243,7 @@ describe 'Problem', ->
it 'toggle the show answer button', -> it 'toggle the show answer button', ->
@problem.show() @problem.show()
expect($('.show')).toHaveValue 'Show Answer' expect($('.show .show-label')).toHaveText 'Show Answer(s)'
it 'remove the showed class from element', -> it 'remove the showed class from element', ->
@problem.show() @problem.show()
......
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