Skip to content

Commit

Permalink
add test for disabling check button while clicking save
Browse files Browse the repository at this point in the history
  • Loading branch information
adampalay committed Nov 3, 2015
1 parent 99cca05 commit bc6caea
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions common/lib/xmodule/xmodule/js/spec/capa/display_spec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,19 @@ describe 'Problem', ->
runs ->
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', ->
beforeEach ->
@problem = new Problem($('.xblock-student_view'))
Expand Down

0 comments on commit bc6caea

Please sign in to comment.