Commit 7106ccba authored by Justin Ho's avatar Justin Ho

Fix specs and update translations

parent 7e6fd78f
...@@ -115,7 +115,6 @@ export default { ...@@ -115,7 +115,6 @@ export default {
:placeholder="$options.i18n.projectKeyPlaceholder" :placeholder="$options.i18n.projectKeyPlaceholder"
:required="enableJiraIssues" :required="enableJiraIssues"
:state="validProjectKey" :state="validProjectKey"
:disabled="!enableJiraIssues"
:readonly="isInheriting" :readonly="isInheriting"
/> />
</gl-form-group> </gl-form-group>
......
...@@ -31,9 +31,7 @@ RSpec.describe EE::IntegrationsHelper do ...@@ -31,9 +31,7 @@ RSpec.describe EE::IntegrationsHelper do
enable_jira_vulnerabilities: 'false', enable_jira_vulnerabilities: 'false',
project_key: 'FE', project_key: 'FE',
vulnerabilities_issuetype: '10001', vulnerabilities_issuetype: '10001',
gitlab_issues_enabled: 'true', upgrade_plan_path: nil
upgrade_plan_path: nil,
edit_project_path: edit_project_path(project, anchor: 'js-shared-permissions')
} }
end end
......
...@@ -21394,7 +21394,7 @@ msgstr "" ...@@ -21394,7 +21394,7 @@ msgstr ""
msgid "JiraService|Define the type of Jira issue to create from a vulnerability." msgid "JiraService|Define the type of Jira issue to create from a vulnerability."
msgstr "" msgstr ""
msgid "JiraService|Displaying Jira issues while leaving GitLab issues also enabled might be confusing. Consider %{linkStart}disabling GitLab issues%{linkEnd} if they won’t otherwise be used." msgid "JiraService|Displaying Jira issues while leaving GitLab issues also enabled might be confusing. Consider %{gitlab_issues_link_start}disabling GitLab issues%{link_end} if they won't otherwise be used."
msgstr "" msgstr ""
msgid "JiraService|Enable Jira issue creation from vulnerabilities" msgid "JiraService|Enable Jira issue creation from vulnerabilities"
...@@ -21445,9 +21445,6 @@ msgstr "" ...@@ -21445,9 +21445,6 @@ msgstr ""
msgid "JiraService|Jira comments are created when an issue is referenced in a merge request." msgid "JiraService|Jira comments are created when an issue is referenced in a merge request."
msgstr "" msgstr ""
msgid "JiraService|Jira issue type"
msgstr ""
msgid "JiraService|Jira issues" msgid "JiraService|Jira issues"
msgstr "" msgstr ""
......
...@@ -10,7 +10,6 @@ describe('JiraIssuesFields', () => { ...@@ -10,7 +10,6 @@ describe('JiraIssuesFields', () => {
let wrapper; let wrapper;
const defaultProps = { const defaultProps = {
editProjectPath: '/edit',
showJiraIssuesIntegration: true, showJiraIssuesIntegration: true,
showJiraVulnerabilitiesIntegration: true, showJiraVulnerabilitiesIntegration: true,
upgradePlanPath: 'https://gitlab.com', upgradePlanPath: 'https://gitlab.com',
...@@ -46,7 +45,6 @@ describe('JiraIssuesFields', () => { ...@@ -46,7 +45,6 @@ describe('JiraIssuesFields', () => {
const findPremiumUpgradeCTA = () => wrapper.findByTestId('premium-upgrade-cta'); const findPremiumUpgradeCTA = () => wrapper.findByTestId('premium-upgrade-cta');
const findUltimateUpgradeCTA = () => wrapper.findByTestId('ultimate-upgrade-cta'); const findUltimateUpgradeCTA = () => wrapper.findByTestId('ultimate-upgrade-cta');
const findJiraForVulnerabilities = () => wrapper.findByTestId('jira-for-vulnerabilities'); const findJiraForVulnerabilities = () => wrapper.findByTestId('jira-for-vulnerabilities');
const findConflictWarning = () => wrapper.findByTestId('conflict-warning-text');
const setEnableCheckbox = async (isEnabled = true) => const setEnableCheckbox = async (isEnabled = true) =>
findEnableCheckbox().vm.$emit('input', isEnabled); findEnableCheckbox().vm.$emit('input', isEnabled);
...@@ -75,10 +73,9 @@ describe('JiraIssuesFields', () => { ...@@ -75,10 +73,9 @@ describe('JiraIssuesFields', () => {
}); });
if (showJiraIssuesIntegration) { if (showJiraIssuesIntegration) {
it('renders checkbox and input field', () => { it('renders enable checkbox', () => {
expect(findEnableCheckbox().exists()).toBe(true); expect(findEnableCheckbox().exists()).toBe(true);
expect(findEnableCheckboxDisabled()).toBeUndefined(); expect(findEnableCheckboxDisabled()).toBeUndefined();
expect(findProjectKey().exists()).toBe(true);
}); });
it('does not render the Premium CTA', () => { it('does not render the Premium CTA', () => {
...@@ -98,9 +95,8 @@ describe('JiraIssuesFields', () => { ...@@ -98,9 +95,8 @@ describe('JiraIssuesFields', () => {
}); });
} }
} else { } else {
it('does not render checkbox and input field', () => { it('does not render enable checkbox', () => {
expect(findEnableCheckbox().exists()).toBe(false); expect(findEnableCheckbox().exists()).toBe(false);
expect(findProjectKey().exists()).toBe(false);
}); });
it('renders the Premium CTA', () => { it('renders the Premium CTA', () => {
...@@ -122,12 +118,8 @@ describe('JiraIssuesFields', () => { ...@@ -122,12 +118,8 @@ describe('JiraIssuesFields', () => {
createComponent({ props: { initialProjectKey: '' } }); createComponent({ props: { initialProjectKey: '' } });
}); });
it('renders disabled project_key input', () => { it('does not render project_key input', () => {
const projectKey = findProjectKey(); expect(findProjectKey().exists()).toBe(false);
expect(projectKey.exists()).toBe(true);
expect(projectKey.attributes('disabled')).toBe('disabled');
expect(projectKey.attributes('required')).toBeUndefined();
}); });
// As per https://vuejs.org/v2/guide/forms.html#Checkbox-1, // As per https://vuejs.org/v2/guide/forms.html#Checkbox-1,
...@@ -137,45 +129,23 @@ describe('JiraIssuesFields', () => { ...@@ -137,45 +129,23 @@ describe('JiraIssuesFields', () => {
}); });
describe('when isInheriting = true', () => { describe('when isInheriting = true', () => {
it('disables checkbox and sets input as readonly', () => { it('disables checkbox', () => {
createComponent({ isInheriting: true }); createComponent({ isInheriting: true });
expect(findEnableCheckboxDisabled()).toBe('disabled'); expect(findEnableCheckboxDisabled()).toBe('disabled');
expect(findProjectKey().attributes('readonly')).toBe('readonly');
}); });
}); });
describe('on enable issues', () => { describe('on enable issues', () => {
it('enables project_key input as required', async () => { it('renders project_key input as required', async () => {
await setEnableCheckbox(true); await setEnableCheckbox(true);
expect(findProjectKey().attributes('disabled')).toBeUndefined(); expect(findProjectKey().exists()).toBe(true);
expect(findProjectKey().attributes('required')).toBe('required'); expect(findProjectKey().attributes('required')).toBe('required');
}); });
}); });
}); });
it('contains link to editProjectPath', () => {
createComponent();
expect(wrapper.find(`a[href="${defaultProps.editProjectPath}"]`).exists()).toBe(true);
});
describe('GitLab issues warning', () => {
it.each`
gitlabIssuesEnabled | scenario
${true} | ${'displays conflict warning'}
${false} | ${'does not display conflict warning'}
`(
'$scenario when `gitlabIssuesEnabled` is `$gitlabIssuesEnabled`',
({ gitlabIssuesEnabled }) => {
createComponent({ props: { gitlabIssuesEnabled } });
expect(findConflictWarning().exists()).toBe(gitlabIssuesEnabled);
},
);
});
describe('Vulnerabilities creation', () => { describe('Vulnerabilities creation', () => {
beforeEach(() => { beforeEach(() => {
createComponent(); createComponent();
......
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