Cancel modals in afterEach in UploadDialog spec.

This commit is contained in:
Usman Khalid
2016-04-21 16:44:43 +05:00
parent 66b53926ff
commit aee139ae61

View File

@@ -15,8 +15,7 @@ define ["js/models/uploads", "js/views/uploads", "js/models/chapter", "common/js
afterEach ->
delete CMS.URL.UPLOAD_ASSET
if (@lastView && modal_helpers.isShowingModal(@lastView))
@lastView.hide()
modal_helpers.cancelModalIfShowing()
createTestView = (test) ->
view = new UploadDialog(
@@ -99,6 +98,7 @@ define ["js/models/uploads", "js/views/uploads", "js/models/chapter", "common/js
@clock = sinon.useFakeTimers()
afterEach ->
modal_helpers.cancelModalIfShowing()
@clock.restore()
it "can upload correctly", ->