debian-mirror-gitlab/spec/javascripts/project_title_spec.js.coffee

38 lines
965 B
CoffeeScript
Raw Normal View History

2016-06-02 11:05:42 +05:30
#= require bootstrap
2016-04-02 18:10:28 +05:30
#= require select2
2016-06-02 11:05:42 +05:30
#= require lib/type_utility
#= require gl_dropdown
2016-04-02 18:10:28 +05:30
#= require api
#= require project_select
#= require project
2016-06-22 15:30:34 +05:30
window.gon or= {}
2016-04-02 18:10:28 +05:30
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-06-02 11:05:42 +05:30
expect($('.header-content').hasClass('open')).toBe(true)
2016-04-02 18:10:28 +05:30
it 'hide dropdown', ->
2016-06-02 11:05:42 +05:30
$(".dropdown-menu-close-icon").click()
2016-04-02 18:10:28 +05:30
2016-06-02 11:05:42 +05:30
expect($('.header-content').hasClass('open')).toBe(false)