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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
ab1bc5c7
Commit
ab1bc5c7
authored
Mar 05, 2018
by
Kushal Pandya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
LabelsSelect DropdownFooter Component
parent
52309322
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
76 additions
and
0 deletions
+76
-0
app/assets/javascripts/vue_shared/components/sidebar/labels_select/dropdown_footer.vue
...ared/components/sidebar/labels_select/dropdown_footer.vue
+34
-0
spec/javascripts/vue_shared/components/sidebar/labels_select/dropdown_footer_spec.js
.../components/sidebar/labels_select/dropdown_footer_spec.js
+42
-0
No files found.
app/assets/javascripts/vue_shared/components/sidebar/labels_select/dropdown_footer.vue
0 → 100644
View file @
ab1bc5c7
<
script
>
export
default
{
props
:
{
labelsWebUrl
:
{
type
:
String
,
required
:
true
,
},
},
};
</
script
>
<
template
>
<div
class=
"dropdown-footer"
>
<ul
class=
"dropdown-footer-list"
>
<li>
<a
href=
"#"
class=
"dropdown-toggle-page"
>
{{
__
(
'
Create new label
'
)
}}
</a>
</li>
<li>
<a
data-is-link=
"true"
class=
"dropdown-external-link"
:href=
"labelsWebUrl"
>
{{
__
(
'
Manage labels
'
)
}}
</a>
</li>
</ul>
</div>
</
template
>
spec/javascripts/vue_shared/components/sidebar/labels_select/dropdown_footer_spec.js
0 → 100644
View file @
ab1bc5c7
import
Vue
from
'
vue
'
;
import
dropdownFooterComponent
from
'
~/vue_shared/components/sidebar/labels_select/dropdown_footer.vue
'
;
import
{
mockConfig
}
from
'
./mock_data
'
;
import
mountComponent
from
'
../../../../helpers/vue_mount_component_helper
'
;
const
createComponent
=
(
labelsWebUrl
=
mockConfig
.
labelsWebUrl
)
=>
{
const
Component
=
Vue
.
extend
(
dropdownFooterComponent
);
return
mountComponent
(
Component
,
{
labelsWebUrl
,
});
};
describe
(
'
DropdownFooterComponent
'
,
()
=>
{
let
vm
;
beforeEach
(()
=>
{
vm
=
createComponent
();
});
afterEach
(()
=>
{
vm
.
$destroy
();
});
describe
(
'
template
'
,
()
=>
{
it
(
'
renders `Create new label` link element
'
,
()
=>
{
const
createLabelEl
=
vm
.
$el
.
querySelector
(
'
.dropdown-footer-list .dropdown-toggle-page
'
);
expect
(
createLabelEl
).
not
.
toBeNull
();
expect
(
createLabelEl
.
innerText
.
trim
()).
toBe
(
'
Create new label
'
);
});
it
(
'
renders `Manage labels` link element
'
,
()
=>
{
const
manageLabelsEl
=
vm
.
$el
.
querySelector
(
'
.dropdown-footer-list .dropdown-external-link
'
);
expect
(
manageLabelsEl
).
not
.
toBeNull
();
expect
(
manageLabelsEl
.
getAttribute
(
'
href
'
)).
toBe
(
vm
.
labelsWebUrl
);
expect
(
manageLabelsEl
.
innerText
.
trim
()).
toBe
(
'
Manage labels
'
);
});
});
});
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