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
bd253ab3
Commit
bd253ab3
authored
Mar 05, 2018
by
Kushal Pandya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
LabelsSelect DropdownHiddenInput Component
parent
ea168553
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
59 additions
and
0 deletions
+59
-0
app/assets/javascripts/vue_shared/components/sidebar/labels_select/dropdown_hidden_input.vue
...omponents/sidebar/labels_select/dropdown_hidden_input.vue
+22
-0
spec/javascripts/vue_shared/components/sidebar/labels_select/dropdown_hidden_input_spec.js
...nents/sidebar/labels_select/dropdown_hidden_input_spec.js
+37
-0
No files found.
app/assets/javascripts/vue_shared/components/sidebar/labels_select/dropdown_hidden_input.vue
0 → 100644
View file @
bd253ab3
<
script
>
export
default
{
props
:
{
name
:
{
type
:
String
,
required
:
true
,
},
label
:
{
type
:
Object
,
required
:
true
,
},
},
};
</
script
>
<
template
>
<input
type=
"hidden"
:name=
"name"
:value=
"label.id"
/>
</
template
>
spec/javascripts/vue_shared/components/sidebar/labels_select/dropdown_hidden_input_spec.js
0 → 100644
View file @
bd253ab3
import
Vue
from
'
vue
'
;
import
dropdownHiddenInputComponent
from
'
~/vue_shared/components/sidebar/labels_select/dropdown_hidden_input.vue
'
;
import
{
mockLabels
}
from
'
./mock_data
'
;
import
mountComponent
from
'
../../../../helpers/vue_mount_component_helper
'
;
const
createComponent
=
(
name
=
'
label_id[]
'
,
label
=
mockLabels
[
0
])
=>
{
const
Component
=
Vue
.
extend
(
dropdownHiddenInputComponent
);
return
mountComponent
(
Component
,
{
name
,
label
,
});
};
describe
(
'
DropdownHiddenInputComponent
'
,
()
=>
{
let
vm
;
beforeEach
(()
=>
{
vm
=
createComponent
();
});
afterEach
(()
=>
{
vm
.
$destroy
();
});
describe
(
'
template
'
,
()
=>
{
it
(
'
renders input element of type `hidden`
'
,
()
=>
{
expect
(
vm
.
$el
.
nodeName
).
toBe
(
'
INPUT
'
);
expect
(
vm
.
$el
.
getAttribute
(
'
type
'
)).
toBe
(
'
hidden
'
);
expect
(
vm
.
$el
.
getAttribute
(
'
name
'
)).
toBe
(
vm
.
name
);
expect
(
vm
.
$el
.
getAttribute
(
'
value
'
)).
toBe
(
`
${
vm
.
label
.
id
}
`
);
});
});
});
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