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

26 lines
684 B
CoffeeScript
Raw Normal View History

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