Commit 352fb6a1 authored by Kev's avatar Kev

Apply changes from review

parent ce93532a
...@@ -8,7 +8,6 @@ import { ...@@ -8,7 +8,6 @@ import {
GlSprintf, GlSprintf,
GlLink, GlLink,
GlIcon, GlIcon,
GlSafeHtmlDirective as SafeHtml,
} from '@gitlab/ui'; } from '@gitlab/ui';
import { s__, __ } from '~/locale'; import { s__, __ } from '~/locale';
import ModalCopyButton from '~/vue_shared/components/modal_copy_button.vue'; import ModalCopyButton from '~/vue_shared/components/modal_copy_button.vue';
...@@ -40,7 +39,6 @@ export default { ...@@ -40,7 +39,6 @@ export default {
directives: { directives: {
GlTooltip: GlTooltipDirective, GlTooltip: GlTooltipDirective,
SafeHtml,
}, },
props: { props: {
...@@ -146,10 +144,12 @@ export default { ...@@ -146,10 +144,12 @@ export default {
" "
> >
<template #docsLinkAnchored="{ content }"> <template #docsLinkAnchored="{ content }">
<gl-link :href="helpClientLibrariesPath" target="_blank">{{ content }}</gl-link> <gl-link :href="helpClientLibrariesPath" target="_blank" data-testid="help-client-link">
{{ content }}
</gl-link>
</template> </template>
<template #docsLink="{ content }"> <template #docsLink="{ content }">
<gl-link :href="helpPath" target="_blank">{{ content }}</gl-link> <gl-link :href="helpPath" target="_blank" data-testid="help-link">{{ content }}</gl-link>
</template> </template>
</gl-sprintf> </gl-sprintf>
</p> </p>
......
...@@ -7,14 +7,7 @@ describe('Configure Feature Flags Modal', () => { ...@@ -7,14 +7,7 @@ describe('Configure Feature Flags Modal', () => {
const mockEvent = { preventDefault: jest.fn() }; const mockEvent = { preventDefault: jest.fn() };
const projectName = 'fakeProjectName'; const projectName = 'fakeProjectName';
let wrapper; const propsData = {
const factory = (props = {}, { mountFn = shallowMount, ...options } = {}) => {
wrapper = mountFn(Component, {
provide: {
projectName,
},
stubs: { GlSprintf },
propsData: {
helpPath: '/help/path', helpPath: '/help/path',
helpClientLibrariesPath: '/help/path/#flags', helpClientLibrariesPath: '/help/path/#flags',
helpClientExamplePath: '/feature-flags#clientexample', helpClientExamplePath: '/feature-flags#clientexample',
...@@ -23,6 +16,17 @@ describe('Configure Feature Flags Modal', () => { ...@@ -23,6 +16,17 @@ describe('Configure Feature Flags Modal', () => {
isRotating: false, isRotating: false,
hasRotateError: false, hasRotateError: false,
canUserRotateToken: true, canUserRotateToken: true,
};
let wrapper;
const factory = (props = {}, { mountFn = shallowMount, ...options } = {}) => {
wrapper = mountFn(Component, {
provide: {
projectName,
},
stubs: { GlSprintf },
propsData: {
...propsData,
...props, ...props,
}, },
...options, ...options,
...@@ -74,11 +78,10 @@ describe('Configure Feature Flags Modal', () => { ...@@ -74,11 +78,10 @@ describe('Configure Feature Flags Modal', () => {
}); });
it('should have links to the documentation', () => { it('should have links to the documentation', () => {
const help = wrapper.find('p'); expect(wrapper.find('[data-testid="help-link"]').attributes('href')).toBe(propsData.helpPath);
const link = help.find('gl-link-stub[href="/help/path"]'); expect(wrapper.find('[data-testid="help-client-link"]').attributes('href')).toBe(
expect(link.exists()).toBe(true); propsData.helpClientLibrariesPath,
const anchoredLink = help.find('gl-link-stub[href="/help/path/#flags"]'); );
expect(anchoredLink.exists()).toBe(true);
}); });
it('should display one and only one danger callout', () => { it('should display one and only one danger callout', () => {
......
...@@ -10716,7 +10716,7 @@ msgstr "" ...@@ -10716,7 +10716,7 @@ msgstr ""
msgid "FeatureFlags|Include additional user IDs" msgid "FeatureFlags|Include additional user IDs"
msgstr "" msgstr ""
msgid "FeatureFlags|Install a %{docs_link_anchored_start}compatible client library%{docs_link_anchored_end} and specify the API URL, application name, and instance ID during the configuration setup. %{docs_link_start}More Information%{docs_link_end}" msgid "FeatureFlags|Install a %{docsLinkAnchoredStart}compatible client library%{docsLinkAnchoredEnd} and specify the API URL, application name, and instance ID during the configuration setup. %{docsLinkStart}More Information%{docsLinkEnd}"
msgstr "" msgstr ""
msgid "FeatureFlags|Instance ID" msgid "FeatureFlags|Instance ID"
......
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