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
d7b37725
Commit
d7b37725
authored
Mar 05, 2018
by
Kushal Pandya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
LabelsSelect DropdownSearchInput Component
parent
bd253ab3
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
66 additions
and
0 deletions
+66
-0
app/assets/javascripts/vue_shared/components/sidebar/labels_select/dropdown_search_input.vue
...omponents/sidebar/labels_select/dropdown_search_input.vue
+27
-0
spec/javascripts/vue_shared/components/sidebar/labels_select/dropdown_search_input_spec.js
...nents/sidebar/labels_select/dropdown_search_input_spec.js
+39
-0
No files found.
app/assets/javascripts/vue_shared/components/sidebar/labels_select/dropdown_search_input.vue
0 → 100644
View file @
d7b37725
<
script
>
export
default
{};
</
script
>
<
template
>
<div
class=
"dropdown-input"
>
<input
autocomplete=
"off"
class=
"dropdown-input-field"
type=
"search"
:placeholder=
"__('Search')"
/>
<i
aria-hidden=
"true"
class=
"fa fa-search dropdown-input-search"
data-hidden=
"true"
>
</i>
<i
aria-hidden=
"true"
class=
"fa fa-times dropdown-input-clear js-dropdown-input-clear"
data-hidden=
"true"
role=
"button"
>
</i>
</div>
</
template
>
spec/javascripts/vue_shared/components/sidebar/labels_select/dropdown_search_input_spec.js
0 → 100644
View file @
d7b37725
import
Vue
from
'
vue
'
;
import
dropdownSearchInputComponent
from
'
~/vue_shared/components/sidebar/labels_select/dropdown_search_input.vue
'
;
import
mountComponent
from
'
../../../../helpers/vue_mount_component_helper
'
;
const
createComponent
=
()
=>
{
const
Component
=
Vue
.
extend
(
dropdownSearchInputComponent
);
return
mountComponent
(
Component
);
};
describe
(
'
DropdownSearchInputComponent
'
,
()
=>
{
let
vm
;
beforeEach
(()
=>
{
vm
=
createComponent
();
});
afterEach
(()
=>
{
vm
.
$destroy
();
});
describe
(
'
template
'
,
()
=>
{
it
(
'
renders input element with type `search`
'
,
()
=>
{
const
inputEl
=
vm
.
$el
.
querySelector
(
'
input.dropdown-input-field
'
);
expect
(
inputEl
).
not
.
toBeNull
();
expect
(
inputEl
.
getAttribute
(
'
type
'
)).
toBe
(
'
search
'
);
});
it
(
'
renders search icon element
'
,
()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.fa-search.dropdown-input-search
'
)).
not
.
toBeNull
();
});
it
(
'
renders clear search icon element
'
,
()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.fa-times.dropdown-input-clear.js-dropdown-input-clear
'
)).
not
.
toBeNull
();
});
});
});
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