2014-12-08 17:21:40 -05:00
|
|
|
AuthModal = require 'views/core/AuthModal'
|
|
|
|
RecoverModal = require 'views/core/RecoverModal'
|
2014-06-13 16:35:57 -04:00
|
|
|
|
2014-07-23 10:02:45 -04:00
|
|
|
describe 'AuthModal', ->
|
2016-02-25 18:24:16 -05:00
|
|
|
|
|
|
|
modal = null
|
|
|
|
|
|
|
|
beforeEach ->
|
2016-06-02 13:59:33 -04:00
|
|
|
application.facebookHandler.fakeAPI()
|
|
|
|
application.gplusHandler.fakeAPI()
|
2016-02-25 18:24:16 -05:00
|
|
|
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', ->
|
2016-02-25 18:24:16 -05:00
|
|
|
spyOn(modal, 'openModalView')
|
|
|
|
modal.$el.find('#link-to-recover').click()
|
|
|
|
expect(modal.openModalView.calls.count()).toEqual(1)
|
|
|
|
args = modal.openModalView.calls.argsFor(0)
|
2014-07-23 10:02:45 -04:00
|
|
|
expect(args[0] instanceof RecoverModal).toBeTruthy()
|
2016-02-25 18:24:16 -05:00
|
|
|
|
|
|
|
it '(demo)', ->
|
2016-06-02 13:59:33 -04:00
|
|
|
jasmine.demoModal(modal)
|