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
Boxiang Sun
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
Show 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
.header-content
%h1
.title
%a
%a
GitLab Org
GitLab Org
%a
.project-item-select-holder
{
href:
"/gitlab-org/gitlab-test"
}
%a
.project-item-select-holder
{
href:
"/gitlab-org/gitlab-test"
}
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
{
"data-toggle"
=>
"dropdown"
,
"data-target"
=>
".header-content"
}
%i
.fa.chevron-down.dropdown-toggle-caret.js-projects-dropdown-toggle
.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 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'
)
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