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
20042c4f
Commit
20042c4f
authored
Oct 12, 2020
by
Marcel Amirault
Committed by
Natalia Tepluhina
Oct 12, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace vue_shared with GitLab UI tooltip in environment_actions.vue
parent
ec4f2d8d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
5 deletions
+18
-5
app/assets/javascripts/environments/components/environment_actions.vue
...vascripts/environments/components/environment_actions.vue
+4
-4
spec/frontend/environments/environment_actions_spec.js
spec/frontend/environments/environment_actions_spec.js
+14
-1
No files found.
app/assets/javascripts/environments/components/environment_actions.vue
View file @
20042c4f
<
script
>
<
script
>
import
{
GlButton
,
GlIcon
,
GlLoadingIcon
}
from
'
@gitlab/ui
'
;
import
{
GlButton
,
GlIcon
,
GlLoadingIcon
,
GlTooltipDirective
}
from
'
@gitlab/ui
'
;
import
{
__
,
s__
,
sprintf
}
from
'
~/locale
'
;
import
{
__
,
s__
,
sprintf
}
from
'
~/locale
'
;
import
{
formatTime
}
from
'
~/lib/utils/datetime_utility
'
;
import
{
formatTime
}
from
'
~/lib/utils/datetime_utility
'
;
import
eventHub
from
'
../event_hub
'
;
import
eventHub
from
'
../event_hub
'
;
import
tooltip
from
'
../../vue_shared/directives/tooltip
'
;
export
default
{
export
default
{
directives
:
{
directives
:
{
tooltip
,
GlTooltip
:
GlTooltipDirective
,
},
},
components
:
{
components
:
{
GlButton
,
GlButton
,
...
@@ -70,13 +69,14 @@ export default {
...
@@ -70,13 +69,14 @@ export default {
<
template
>
<
template
>
<div
class=
"btn-group"
role=
"group"
>
<div
class=
"btn-group"
role=
"group"
>
<gl-button
<gl-button
v-tooltip
v-
gl-
tooltip
:title=
"title"
:title=
"title"
:aria-label=
"title"
:aria-label=
"title"
:disabled=
"isLoading"
:disabled=
"isLoading"
class=
"dropdown dropdown-new js-environment-actions-dropdown"
class=
"dropdown dropdown-new js-environment-actions-dropdown"
data-container=
"body"
data-container=
"body"
data-toggle=
"dropdown"
data-toggle=
"dropdown"
data-testid=
"environment-actions-button"
>
>
<span>
<span>
<gl-icon
name=
"play"
/>
<gl-icon
name=
"play"
/>
...
...
spec/frontend/environments/environment_actions_spec.js
View file @
20042c4f
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
TEST_HOST
}
from
'
helpers/test_constants
'
;
import
{
TEST_HOST
}
from
'
helpers/test_constants
'
;
import
{
GlLoadingIcon
,
GlIcon
}
from
'
@gitlab/ui
'
;
import
{
GlLoadingIcon
,
GlIcon
}
from
'
@gitlab/ui
'
;
import
{
createMockDirective
,
getBinding
}
from
'
helpers/vue_mock_directive
'
;
import
eventHub
from
'
~/environments/event_hub
'
;
import
eventHub
from
'
~/environments/event_hub
'
;
import
EnvironmentActions
from
'
~/environments/components/environment_actions.vue
'
;
import
EnvironmentActions
from
'
~/environments/components/environment_actions.vue
'
;
describe
(
'
EnvironmentActions Component
'
,
()
=>
{
describe
(
'
EnvironmentActions Component
'
,
()
=>
{
let
vm
;
let
vm
;
const
findEnvironmentActionsButton
=
()
=>
vm
.
find
(
'
[data-testid="environment-actions-button"]
'
);
beforeEach
(()
=>
{
beforeEach
(()
=>
{
vm
=
shallowMount
(
EnvironmentActions
,
{
propsData
:
{
actions
:
[]
}
});
vm
=
shallowMount
(
EnvironmentActions
,
{
propsData
:
{
actions
:
[]
},
directives
:
{
GlTooltip
:
createMockDirective
(),
},
});
});
});
afterEach
(()
=>
{
afterEach
(()
=>
{
...
@@ -23,6 +31,11 @@ describe('EnvironmentActions Component', () => {
...
@@ -23,6 +31,11 @@ describe('EnvironmentActions Component', () => {
expect
(
vm
.
find
(
'
.dropdown-new
'
).
attributes
(
'
aria-label
'
)).
toEqual
(
'
Deploy to...
'
);
expect
(
vm
.
find
(
'
.dropdown-new
'
).
attributes
(
'
aria-label
'
)).
toEqual
(
'
Deploy to...
'
);
});
});
it
(
'
should render a tooltip
'
,
()
=>
{
const
tooltip
=
getBinding
(
findEnvironmentActionsButton
().
element
,
'
gl-tooltip
'
);
expect
(
tooltip
).
toBeDefined
();
});
describe
(
'
is loading
'
,
()
=>
{
describe
(
'
is loading
'
,
()
=>
{
beforeEach
(()
=>
{
beforeEach
(()
=>
{
vm
.
setData
({
isLoading
:
true
});
vm
.
setData
({
isLoading
:
true
});
...
...
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