Commit 1665bfba authored by Savas Vedova's avatar Savas Vedova

Fixes the default issue type id

- Update specs to test the passed down value
parent b44fe05c
...@@ -49,7 +49,7 @@ export default { ...@@ -49,7 +49,7 @@ export default {
initialVulnerabilitiesIssuetype: { initialVulnerabilitiesIssuetype: {
type: String, type: String,
required: false, required: false,
default: '', default: undefined,
}, },
initialProjectKey: { initialProjectKey: {
type: String, type: String,
......
...@@ -126,6 +126,20 @@ describe('JiraIssuesFields', () => { ...@@ -126,6 +126,20 @@ describe('JiraIssuesFields', () => {
}, },
); );
it('passes down the correct initial-issue-type-id value when value is empty', async () => {
await setEnableCheckbox(true);
expect(findJiraForVulnerabilities().attributes('initial-issue-type-id')).toBeUndefined();
});
it('passes down the correct initial-issue-type-id value when value is not empty', async () => {
const jiraIssueType = 'some-jira-issue-type';
wrapper.setProps({ initialVulnerabilitiesIssuetype: jiraIssueType });
await setEnableCheckbox(true);
expect(findJiraForVulnerabilities().attributes('initial-issue-type-id')).toBe(
jiraIssueType,
);
});
it('emits "getJiraIssueTypes" to the eventHub when the jira-vulnerabilities component requests to fetch issue types', async () => { it('emits "getJiraIssueTypes" to the eventHub when the jira-vulnerabilities component requests to fetch issue types', async () => {
const eventHubEmitSpy = jest.spyOn(eventHub, '$emit'); const eventHubEmitSpy = jest.spyOn(eventHub, '$emit');
......
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