Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tatuya Kamada
gitlab-ce
Commits
14b124fa
Commit
14b124fa
authored
Mar 29, 2016
by
Phil Hughes
Committed by
Jacob Schatz
Apr 12, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tests update
parent
f870857d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
22 deletions
+24
-22
spec/javascripts/fixtures/project_title.html.haml
spec/javascripts/fixtures/project_title.html.haml
+19
-7
spec/javascripts/project_title_spec.js.coffee
spec/javascripts/project_title_spec.js.coffee
+5
-15
No files found.
spec/javascripts/fixtures/project_title.html.haml
View file @
14b124fa
%h1
.title
%a
GitLab Org
%a
.project-item-select-holder
{
href:
"/gitlab-org/gitlab-test"
}
GitLab Test
%input
#project_path
.project-item-select.js-projects-dropdown.ajax-project-select
{
type:
"hidden"
,
name:
"project_path"
,
"data-include-groups"
=>
"false"
}
%i
.fa.chevron-down.dropdown-toggle-caret.js-projects-dropdown-toggle
.header-content
%h1
.title
%a
GitLab Org
%a
.project-item-select-holder
{
href:
"/gitlab-org/gitlab-test"
}
GitLab Test
%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
spec/javascripts/project_title_spec.js.coffee
View file @
14b124fa
#= require bootstrap
#= require select2
#= require gl_dropdown
#= require api
#= require project_select
#= require project
...
...
@@ -14,9 +16,6 @@ describe 'Project Title', ->
fixture
.
load
(
'project_title.html'
)
@
project
=
new
Project
()
spyOn
(
@
project
,
'changeProject'
).
and
.
callFake
(
url
)
->
window
.
current_project_url
=
url
describe
'project list'
,
->
beforeEach
=>
@
projects_data
=
fixture
.
load
(
'projects.json'
)[
0
]
...
...
@@ -29,18 +28,9 @@ describe 'Project Title', ->
it
'to show on toggle click'
,
=>
$
(
'.js-projects-dropdown-toggle'
).
click
()
expect
(
$
(
'.title .select2-container'
).
hasClass
(
'select2-dropdown-open'
)).
toBe
(
true
)
expect
(
$
(
'.ajax-project-dropdown li'
).
length
).
toBe
(
@
projects_data
.
length
)
expect
(
$
(
'.header-content'
).
hasClass
(
'open'
)).
toBe
(
true
)
it
'hide dropdown'
,
->
$
(
"#select2-drop-mask"
).
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'
)
$
(
".dropdown-menu-close-icon"
).
click
()
expect
(
$
(
'.title .select2-container'
).
hasClass
(
'select2-dropdown-open'
)).
toBe
(
false
)
expect
(
window
.
current_project_url
).
toBe
(
'http://localhost:3000/h5bp/html5-boilerplate'
)
expect
(
$
(
'.header-content'
).
hasClass
(
'open'
)).
toBe
(
false
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment