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

Fix specs and update translations

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