Commit 14b124fa authored by Phil Hughes's avatar Phil Hughes Committed by Jacob Schatz

Tests update

parent f870857d
%h1.title .header-content
%a %h1.title
GitLab Org %a
%a.project-item-select-holder{href: "/gitlab-org/gitlab-test"} GitLab Org
GitLab Test %a.project-item-select-holder{href: "/gitlab-org/gitlab-test"}
%input#project_path.project-item-select.js-projects-dropdown.ajax-project-select{type: "hidden", name: "project_path", "data-include-groups" => "false"} GitLab Test
%i.fa.chevron-down.dropdown-toggle-caret.js-projects-dropdown-toggle %i.fa.chevron-down.dropdown-toggle-caret.js-projects-dropdown-toggle{ "data-toggle" => "dropdown", "data-target" => ".header-content" }
.dropdown-menu.dropdown-select.dropdown-menu-projects
.dropdown-title
%span Go to a project
%button.dropdown-title-button.dropdown-menu-close{"aria-label" => "Close", type: "button"}
%i.fa.fa-times.dropdown-menu-close-icon
.dropdown-input
%input.dropdown-input-field{id: "", placeholder: "Search your projects", type: "search", value: ""}
%i.fa.fa-search.dropdown-input-search
%i.fa.fa-times.dropdown-input-clear.js-dropdown-input-clear{role: "button"}
.dropdown-content
.dropdown-loading
%i.fa.fa-spinner.fa-spin
#= require bootstrap
#= require select2 #= require select2
#= require gl_dropdown
#= require api #= require api
#= require project_select #= require project_select
#= require project #= require project
...@@ -14,9 +16,6 @@ describe 'Project Title', -> ...@@ -14,9 +16,6 @@ describe 'Project Title', ->
fixture.load('project_title.html') fixture.load('project_title.html')
@project = new Project() @project = new Project()
spyOn(@project, 'changeProject').and.callFake (url) ->
window.current_project_url = url
describe 'project list', -> describe 'project list', ->
beforeEach => beforeEach =>
@projects_data = fixture.load('projects.json')[0] @projects_data = fixture.load('projects.json')[0]
...@@ -29,18 +28,9 @@ describe 'Project Title', -> ...@@ -29,18 +28,9 @@ describe 'Project Title', ->
it 'to show on toggle click', => it 'to show on toggle click', =>
$('.js-projects-dropdown-toggle').click() $('.js-projects-dropdown-toggle').click()
expect($('.header-content').hasClass('open')).toBe(true)
expect($('.title .select2-container').hasClass('select2-dropdown-open')).toBe(true)
expect($('.ajax-project-dropdown li').length).toBe(@projects_data.length)
it 'hide dropdown', -> it 'hide dropdown', ->
$("#select2-drop-mask").click() $(".dropdown-menu-close-icon").click()
expect($('.title .select2-container').hasClass('select2-dropdown-open')).toBe(false)
it 'change project when clicking item', ->
$('.js-projects-dropdown-toggle').click()
$('.ajax-project-dropdown li:nth-child(2)').trigger('mouseup')
expect($('.title .select2-container').hasClass('select2-dropdown-open')).toBe(false) expect($('.header-content').hasClass('open')).toBe(false)
expect(window.current_project_url).toBe('http://localhost:3000/h5bp/html5-boilerplate')
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment