2016-03-29 08:21:22 -04:00
|
|
|
#= require bootstrap
|
2016-01-17 12:19:50 -05:00
|
|
|
#= require select2
|
2016-05-13 11:57:03 -04:00
|
|
|
#= require lib/type_utility
|
2016-03-29 08:21:22 -04:00
|
|
|
#= require gl_dropdown
|
2016-01-17 12:19:50 -05:00
|
|
|
#= require api
|
|
|
|
#= require project_select
|
|
|
|
#= require project
|
|
|
|
|
|
|
|
window.gon = {}
|
|
|
|
window.gon.api_version = 'v3'
|
|
|
|
|
|
|
|
describe 'Project Title', ->
|
|
|
|
fixture.preload('project_title.html')
|
|
|
|
fixture.preload('projects.json')
|
|
|
|
|
|
|
|
beforeEach ->
|
|
|
|
fixture.load('project_title.html')
|
|
|
|
@project = new Project()
|
|
|
|
|
|
|
|
describe 'project list', ->
|
|
|
|
beforeEach =>
|
|
|
|
@projects_data = fixture.load('projects.json')[0]
|
|
|
|
|
|
|
|
spyOn(jQuery, 'ajax').and.callFake (req) =>
|
|
|
|
expect(req.url).toBe('/api/v3/projects.json')
|
|
|
|
d = $.Deferred()
|
|
|
|
d.resolve @projects_data
|
|
|
|
d.promise()
|
|
|
|
|
|
|
|
it 'to show on toggle click', =>
|
|
|
|
$('.js-projects-dropdown-toggle').click()
|
2016-03-29 08:21:22 -04:00
|
|
|
expect($('.header-content').hasClass('open')).toBe(true)
|
2016-01-17 12:19:50 -05:00
|
|
|
|
|
|
|
it 'hide dropdown', ->
|
2016-03-29 08:21:22 -04:00
|
|
|
$(".dropdown-menu-close-icon").click()
|
2016-01-17 12:19:50 -05:00
|
|
|
|
2016-03-29 08:21:22 -04:00
|
|
|
expect($('.header-content').hasClass('open')).toBe(false)
|