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
Léo-Paul Géneau
gitlab-ce
Commits
8b44ad6e
Commit
8b44ad6e
authored
Mar 05, 2018
by
Kushal Pandya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
LabelsSelect DropdownTitle Component
parent
2e5497f0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
72 additions
and
0 deletions
+72
-0
app/assets/javascripts/vue_shared/components/sidebar/labels_select/dropdown_title.vue
...hared/components/sidebar/labels_select/dropdown_title.vue
+30
-0
spec/javascripts/vue_shared/components/sidebar/labels_select/dropdown_title_spec.js
...d/components/sidebar/labels_select/dropdown_title_spec.js
+42
-0
No files found.
app/assets/javascripts/vue_shared/components/sidebar/labels_select/dropdown_title.vue
0 → 100644
View file @
8b44ad6e
<
script
>
export
default
{
props
:
{
canEdit
:
{
type
:
Boolean
,
required
:
true
,
},
},
};
</
script
>
<
template
>
<div
class=
"title hide-collapsed append-bottom-10"
>
{{
__
(
'
Labels
'
)
}}
<template
v-if=
"canEdit"
>
<i
aria-hidden=
"true"
class=
"fa fa-spinner fa-spin block-loading"
data-hidden=
"true"
>
</i>
<button
type=
"button"
class=
"edit-link btn btn-blank pull-right js-sidebar-dropdown-toggle"
>
{{
__
(
'
Edit
'
)
}}
</button>
</
template
>
</div>
</template>
spec/javascripts/vue_shared/components/sidebar/labels_select/dropdown_title_spec.js
0 → 100644
View file @
8b44ad6e
import
Vue
from
'
vue
'
;
import
dropdownTitleComponent
from
'
~/vue_shared/components/sidebar/labels_select/dropdown_title.vue
'
;
import
mountComponent
from
'
../../../../helpers/vue_mount_component_helper
'
;
const
createComponent
=
(
canEdit
=
true
)
=>
{
const
Component
=
Vue
.
extend
(
dropdownTitleComponent
);
return
mountComponent
(
Component
,
{
canEdit
,
});
};
describe
(
'
DropdownTitleComponent
'
,
()
=>
{
let
vm
;
beforeEach
(()
=>
{
vm
=
createComponent
();
});
afterEach
(()
=>
{
vm
.
$destroy
();
});
describe
(
'
template
'
,
()
=>
{
it
(
'
renders title text
'
,
()
=>
{
expect
(
vm
.
$el
.
classList
.
contains
(
'
title
'
,
'
hide-collapsed
'
)).
toBe
(
true
);
expect
(
vm
.
$el
.
innerText
.
trim
()).
toContain
(
'
Labels
'
);
});
it
(
'
renders spinner icon element
'
,
()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.fa-spinner.fa-spin.block-loading
'
)).
not
.
toBeNull
();
});
it
(
'
renders `Edit` button element
'
,
()
=>
{
const
editBtnEl
=
vm
.
$el
.
querySelector
(
'
button.edit-link.js-sidebar-dropdown-toggle
'
);
expect
(
editBtnEl
).
not
.
toBeNull
();
expect
(
editBtnEl
.
innerText
.
trim
()).
toBe
(
'
Edit
'
);
});
});
});
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