Commit 8c1c06ec authored by Austin Regnery's avatar Austin Regnery

Update tests for tooltip and text removal

parent f46ec577
...@@ -109,11 +109,10 @@ export default { ...@@ -109,11 +109,10 @@ export default {
<div v-if="hasDropdownActions" class="gl-p-2"> <div v-if="hasDropdownActions" class="gl-p-2">
<gl-dropdown <gl-dropdown
data-testid="dropdown-toggle" data-testid="dropdown-toggle"
:text-sr-only="!showButtonLabels" v-gl-tooltip="$options.i18n.userAdministration"
icon="ellipsis_v" icon="ellipsis_v"
data-qa-selector="user_actions_dropdown_toggle" data-qa-selector="user_actions_dropdown_toggle"
:data-qa-username="user.username" :data-qa-username="user.username"
v-gl-tooltip="$options.i18n.userAdministration"
no-caret no-caret
right right
> >
......
...@@ -77,6 +77,12 @@ describe('AdminUserActions component', () => { ...@@ -77,6 +77,12 @@ describe('AdminUserActions component', () => {
expect(findActionsDropdown().exists()).toBe(true); 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', () => { describe('when there are actions that require confirmation', () => {
beforeEach(() => { beforeEach(() => {
initComponent({ actions: CONFIRMATION_ACTIONS }); initComponent({ actions: CONFIRMATION_ACTIONS });
...@@ -152,7 +158,7 @@ describe('AdminUserActions component', () => { ...@@ -152,7 +158,7 @@ describe('AdminUserActions component', () => {
describe('when `showButtonLabels` prop is `false`', () => { describe('when `showButtonLabels` prop is `false`', () => {
beforeEach(() => { beforeEach(() => {
initComponent({ actions: [EDIT, ...CONFIRMATION_ACTIONS] }); initComponent({ actions: [EDIT] });
}); });
it('does not render "Edit" button label', () => { it('does not render "Edit" button label', () => {
...@@ -163,16 +169,11 @@ describe('AdminUserActions component', () => { ...@@ -163,16 +169,11 @@ describe('AdminUserActions component', () => {
expect(tooltip).toBeDefined(); expect(tooltip).toBeDefined();
expect(tooltip.value).toBe(I18N_USER_ACTIONS.edit); 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`', () => { describe('when `showButtonLabels` prop is `true`', () => {
beforeEach(() => { beforeEach(() => {
initComponent({ actions: [EDIT, ...CONFIRMATION_ACTIONS], showButtonLabels: true }); initComponent({ actions: [EDIT], showButtonLabels: true });
}); });
it('renders "Edit" button label', () => { it('renders "Edit" button label', () => {
...@@ -181,10 +182,5 @@ describe('AdminUserActions component', () => { ...@@ -181,10 +182,5 @@ describe('AdminUserActions component', () => {
expect(findEditButton().text()).toBe(I18N_USER_ACTIONS.edit); expect(findEditButton().text()).toBe(I18N_USER_ACTIONS.edit);
expect(tooltip).not.toBeDefined(); 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);
});
}); });
}); });
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment