codecombat/test/app/views/core/AuthModal.spec.coffee
Scott Erickson 13ca4a6174 Fix intermittent CreateAccountModal error
AuthModal spec was loading the G+ API during tests, which
caused G+ to get unhappy when CreateAccountModal mocked it.
2016-06-02 10:59:45 -07:00

25 lines
684 B
CoffeeScript

AuthModal = require 'views/core/AuthModal'
RecoverModal = require 'views/core/RecoverModal'
describe 'AuthModal', ->
modal = null
beforeEach ->
application.facebookHandler.fakeAPI()
application.gplusHandler.fakeAPI()
modal = new AuthModal()
modal.render()
afterEach ->
modal.stopListening()
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)