codecombat/test/app/views/modal/AuthModal.spec.coffee

13 lines
453 B
CoffeeScript
Raw Normal View History

AuthModal = require 'views/modal/AuthModal'
RecoverModal = require 'views/modal/RecoverModal'
2014-06-13 16:35:57 -04:00
describe 'AuthModal', ->
2014-06-13 16:35:57 -04:00
it 'opens the recover modal when you click the recover link', ->
m = new AuthModal()
2014-06-13 16:35:57 -04:00
m.render()
spyOn(m, 'openModalView')
m.$el.find('#link-to-recover').click()
expect(m.openModalView.calls.count()).toEqual(1)
args = m.openModalView.calls.argsFor(0)
expect(args[0] instanceof RecoverModal).toBeTruthy()