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
8c1c06ec
Commit
8c1c06ec
authored
Feb 28, 2022
by
Austin Regnery
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update tests for tooltip and text removal
parent
f46ec577
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
14 deletions
+9
-14
app/assets/javascripts/admin/users/components/user_actions.vue
...ssets/javascripts/admin/users/components/user_actions.vue
+1
-2
spec/frontend/admin/users/components/user_actions_spec.js
spec/frontend/admin/users/components/user_actions_spec.js
+8
-12
No files found.
app/assets/javascripts/admin/users/components/user_actions.vue
View file @
8c1c06ec
...
...
@@ -109,11 +109,10 @@ export default {
<div
v-if=
"hasDropdownActions"
class=
"gl-p-2"
>
<gl-dropdown
data-testid=
"dropdown-toggle"
:text-sr-only=
"!showButtonLabels
"
v-gl-tooltip=
"$options.i18n.userAdministration
"
icon=
"ellipsis_v"
data-qa-selector=
"user_actions_dropdown_toggle"
:data-qa-username=
"user.username"
v-gl-tooltip=
"$options.i18n.userAdministration"
no-caret
right
>
...
...
spec/frontend/admin/users/components/user_actions_spec.js
View file @
8c1c06ec
...
...
@@ -77,6 +77,12 @@ describe('AdminUserActions component', () => {
expect
(
findActionsDropdown
().
exists
()).
toBe
(
true
);
});
it
(
'
renders the tooltip
'
,
()
=>
{
const
tooltip
=
getBinding
(
findActionsDropdown
().
element
,
'
gl-tooltip
'
);
expect
(
tooltip
.
value
).
toBe
(
I18N_USER_ACTIONS
.
userAdministration
);
});
describe
(
'
when there are actions that require confirmation
'
,
()
=>
{
beforeEach
(()
=>
{
initComponent
({
actions
:
CONFIRMATION_ACTIONS
});
...
...
@@ -152,7 +158,7 @@ describe('AdminUserActions component', () => {
describe
(
'
when `showButtonLabels` prop is `false`
'
,
()
=>
{
beforeEach
(()
=>
{
initComponent
({
actions
:
[
EDIT
,
...
CONFIRMATION_ACTIONS
]
});
initComponent
({
actions
:
[
EDIT
]
});
});
it
(
'
does not render "Edit" button label
'
,
()
=>
{
...
...
@@ -163,16 +169,11 @@ describe('AdminUserActions component', () => {
expect
(
tooltip
).
toBeDefined
();
expect
(
tooltip
.
value
).
toBe
(
I18N_USER_ACTIONS
.
edit
);
});
it
(
'
does not render "User administration" dropdown button label
'
,
()
=>
{
expect
(
findActionsDropdown
().
props
(
'
text
'
)).
toBe
(
I18N_USER_ACTIONS
.
userAdministration
);
expect
(
findActionsDropdown
().
props
(
'
textSrOnly
'
)).
toBe
(
true
);
});
});
describe
(
'
when `showButtonLabels` prop is `true`
'
,
()
=>
{
beforeEach
(()
=>
{
initComponent
({
actions
:
[
EDIT
,
...
CONFIRMATION_ACTIONS
],
showButtonLabels
:
true
});
initComponent
({
actions
:
[
EDIT
],
showButtonLabels
:
true
});
});
it
(
'
renders "Edit" button label
'
,
()
=>
{
...
...
@@ -181,10 +182,5 @@ describe('AdminUserActions component', () => {
expect
(
findEditButton
().
text
()).
toBe
(
I18N_USER_ACTIONS
.
edit
);
expect
(
tooltip
).
not
.
toBeDefined
();
});
it
(
'
renders "User administration" dropdown button label
'
,
()
=>
{
expect
(
findActionsDropdown
().
props
(
'
text
'
)).
toBe
(
I18N_USER_ACTIONS
.
userAdministration
);
expect
(
findActionsDropdown
().
props
(
'
textSrOnly
'
)).
toBe
(
false
);
});
});
});
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