Commit cc6c0698 authored by Enrique Alcántara's avatar Enrique Alcántara

Merge branch 'eread/use-text-links-in-mr-approval-settings-ui' into 'master'

Use text links in MR approval settings section of UI

See merge request gitlab-org/gitlab!67737
parents deeceeea 7ecc2da2
...@@ -51,7 +51,7 @@ export default { ...@@ -51,7 +51,7 @@ export default {
}, },
}, },
i18n: { i18n: {
helpLabel: __('Help'), helpLinkText: __('Learn more.'),
lockIconTitle: __('Setting enforced'), lockIconTitle: __('Setting enforced'),
}, },
}; };
...@@ -72,12 +72,7 @@ export default { ...@@ -72,12 +72,7 @@ export default {
/> />
</template> </template>
<gl-link :href="href" target="_blank"> <gl-link :href="href" target="_blank">
<gl-icon {{ $options.i18n.helpLinkText }}
data-testid="help-icon"
name="question-o"
:aria-label="$options.i18n.helpLabel"
:size="16"
/>
</gl-link> </gl-link>
</gl-form-checkbox> </gl-form-checkbox>
</template> </template>
...@@ -33,7 +33,6 @@ describe('ApprovalSettingsCheckbox', () => { ...@@ -33,7 +33,6 @@ describe('ApprovalSettingsCheckbox', () => {
const findLink = () => wrapper.findComponent(GlLink); const findLink = () => wrapper.findComponent(GlLink);
const findPopover = () => wrapper.findComponent(GlPopover); const findPopover = () => wrapper.findComponent(GlPopover);
const findLockIcon = () => wrapper.findByTestId('lock-icon'); const findLockIcon = () => wrapper.findByTestId('lock-icon');
const findHelpIcon = () => wrapper.findByTestId('help-icon');
afterEach(() => { afterEach(() => {
wrapper.destroy(); wrapper.destroy();
...@@ -45,15 +44,15 @@ describe('ApprovalSettingsCheckbox', () => { ...@@ -45,15 +44,15 @@ describe('ApprovalSettingsCheckbox', () => {
}); });
it('shows the label', () => { it('shows the label', () => {
expect(findCheckbox().text()).toBe(label); expect(findCheckbox().text()).toContain(label);
}); });
it('sets the correct help link', () => { it('shows the help text', () => {
expect(findLink().attributes('href')).toBe(`/help/${APPROVALS_HELP_PATH}#${anchor}`); expect(findCheckbox().text()).toContain('Learn more.');
}); });
it('shows a help icon', () => { it('sets the correct help link', () => {
expect(findHelpIcon().props('name')).toBe('question-o'); expect(findLink().attributes('href')).toBe(`/help/${APPROVALS_HELP_PATH}#${anchor}`);
}); });
}); });
......
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