Commit bc6caea6 by Adam Palay

add test for disabling check button while clicking save

parent 99cca057
...@@ -538,6 +538,19 @@ describe 'Problem', -> ...@@ -538,6 +538,19 @@ describe 'Problem', ->
runs -> runs ->
expect(window.SR.readElts).toHaveBeenCalled() expect(window.SR.readElts).toHaveBeenCalled()
it 'disables check button while posting', ->
runs ->
spyOn($, 'postWithPrefix').andCallFake (url, answers, callback) -> callback(success: 'OK')
spyOn @problem, 'enableCheckButton'
@problem.save()
expect(@problem.enableCheckButton).toHaveBeenCalledWith false
waitsFor (->
return jQuery.active == 0
), "jQuery requests finished", 1000
runs ->
expect(@problem.enableCheckButton).toHaveBeenCalledWith true
describe 'refreshMath', -> describe 'refreshMath', ->
beforeEach -> beforeEach ->
@problem = new Problem($('.xblock-student_view')) @problem = new Problem($('.xblock-student_view'))
......
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