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
0d99f6c6
Commit
0d99f6c6
authored
Jan 11, 2018
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds props to allow tooltip config. Breaks tests into specific cases
parent
e331ca13
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
1 deletion
+19
-1
app/assets/javascripts/vue_shared/components/clipboard_button.vue
...ts/javascripts/vue_shared/components/clipboard_button.vue
+12
-0
spec/javascripts/vue_shared/components/clipboard_button_spec.js
...avascripts/vue_shared/components/clipboard_button_spec.js
+7
-1
No files found.
app/assets/javascripts/vue_shared/components/clipboard_button.vue
View file @
0d99f6c6
...
...
@@ -18,6 +18,16 @@
type
:
String
,
required
:
true
,
},
tooltipPlacement
:
{
type
:
String
,
required
:
false
,
default
:
'
top
'
,
},
tooltipContainer
:
{
type
:
[
String
,
Boolean
],
required
:
false
,
default
:
false
,
},
},
};
</
script
>
...
...
@@ -29,6 +39,8 @@
:title=
"title"
:data-clipboard-text=
"text"
v-tooltip
:data-container=
"tooltipContainer"
:data-placement=
"tooltipPlacement"
>
<i
aria-hidden=
"true"
...
...
spec/javascripts/vue_shared/components/clipboard_button_spec.js
View file @
0d99f6c6
...
...
@@ -17,9 +17,15 @@ describe('clipboard button', () => {
vm
.
$destroy
();
});
it
(
'
renders a button for clipboard
with a tooltip
'
,
()
=>
{
it
(
'
renders a button for clipboard
'
,
()
=>
{
expect
(
vm
.
$el
.
tagName
).
toEqual
(
'
BUTTON
'
);
expect
(
vm
.
$el
.
getAttribute
(
'
data-clipboard-text
'
)).
toEqual
(
'
copy me
'
);
expect
(
vm
.
$el
.
querySelector
(
'
i
'
).
className
).
toEqual
(
'
fa fa-clipboard
'
);
});
it
(
'
should have a tooltip with default values
'
,
()
=>
{
expect
(
vm
.
$el
.
getAttribute
(
'
data-original-title
'
)).
toEqual
(
'
Copy this value into Clipboard!
'
);
expect
(
vm
.
$el
.
getAttribute
(
'
data-placement
'
)).
toEqual
(
'
top
'
);
expect
(
vm
.
$el
.
getAttribute
(
'
data-container
'
)).
toEqual
(
null
);
});
});
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