Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
82748bbb
Commit
82748bbb
authored
Jul 05, 2021
by
Tom Quirk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Consolidate Jira integration CTA specs
Per reviewer feedback, paramaterize CTA specs for better readability.
parent
703c5542
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
55 deletions
+55
-55
spec/frontend/integrations/edit/components/jira_issues_fields_spec.js
...d/integrations/edit/components/jira_issues_fields_spec.js
+55
-55
No files found.
spec/frontend/integrations/edit/components/jira_issues_fields_spec.js
View file @
82748bbb
...
...
@@ -44,66 +44,66 @@ describe('JiraIssuesFields', () => {
findEnableCheckbox
().
vm
.
$emit
(
'
input
'
,
isEnabled
);
describe
(
'
template
'
,
()
=>
{
describe
(
'
when `showJiraIssuesIntegration` is false
'
,
()
=>
{
beforeEach
(()
=>
{
createComponent
({
props
:
{
showJiraIssuesIntegration
:
false
},
});
});
it
(
'
shows the premium CTA
'
,
()
=>
{
const
premiumUpgradeCTA
=
findPremiumUpgradeCTA
();
expect
(
premiumUpgradeCTA
.
exists
()).
toBe
(
true
);
expect
(
premiumUpgradeCTA
.
props
(
'
upgradePlanPath
'
)).
toBe
(
defaultProps
.
upgradePlanPath
);
});
it
(
'
does not show checkbox and input field
'
,
()
=>
{
expect
(
findEnableCheckbox
().
exists
()).
toBe
(
false
);
expect
(
findProjectKey
().
exists
()).
toBe
(
false
);
});
});
describe
(
'
when `showJiraIssuesIntegration` is true and `showJiraVulnerabilitiesIntegration` is false
'
,
()
=>
{
beforeEach
(()
=>
{
createComponent
({
props
:
{
showJiraIssuesIntegration
:
true
,
showJiraVulnerabilitiesIntegration
:
false
},
describe
.
each
`
showJiraIssuesIntegration | showJiraVulnerabilitiesIntegration
${
false
}
|
${
false
}
${
false
}
|
${
true
}
${
true
}
|
${
false
}
${
true
}
|
${
true
}
`
(
'
when `showJiraIssuesIntegration` is $jiraIssues and `showJiraVulnerabilitiesIntegration` is $jiraVulnerabilities
'
,
({
showJiraIssuesIntegration
,
showJiraVulnerabilitiesIntegration
})
=>
{
beforeEach
(()
=>
{
createComponent
({
props
:
{
showJiraIssuesIntegration
,
showJiraVulnerabilitiesIntegration
,
},
});
});
});
it
(
'
renders "Enable Jira Issues" checkbox
'
,
()
=>
{
expect
(
findEnableCheckbox
().
exists
()).
toBe
(
true
);
expect
(
findEnableCheckboxDisabled
()).
toBeUndefined
();
});
it
.
each
`
scenario | enableJiraIssues
${
'
when "Enable Jira Issues" is checked, shows ultimate upgrade CTA
'
}
|
${
true
}
${
'
when "Enable Jira Issues" is unchecked, does not show ultimate upgrade CTA
'
}
|
${
false
}
`
(
'
$scenario
'
,
async
({
enableJiraIssues
})
=>
{
createComponent
({
props
:
{
showJiraIssuesIntegration
:
true
,
showJiraVulnerabilitiesIntegration
:
false
},
});
if
(
enableJiraIssues
)
{
await
setEnableCheckbox
();
if
(
showJiraIssuesIntegration
)
{
it
(
'
renders checkbox and input field
'
,
()
=>
{
expect
(
findEnableCheckbox
().
exists
()).
toBe
(
true
);
expect
(
findEnableCheckboxDisabled
()).
toBeUndefined
();
expect
(
findProjectKey
().
exists
()).
toBe
(
true
);
});
it
(
'
does not render the Premium CTA
'
,
()
=>
{
expect
(
findPremiumUpgradeCTA
().
exists
()).
toBe
(
false
);
});
if
(
!
showJiraVulnerabilitiesIntegration
)
{
it
.
each
`
scenario | enableJiraIssues
${
'
when "Enable Jira issues" is checked, renders Ultimate upgrade CTA
'
}
|
${
true
}
${
'
when "Enable Jira issues" is unchecked, does not render Ultimate upgrade CTA
'
}
|
${
false
}
`
(
'
$scenario
'
,
async
({
enableJiraIssues
})
=>
{
if
(
enableJiraIssues
)
{
await
setEnableCheckbox
();
}
expect
(
findUltimateUpgradeCTA
().
exists
()).
toBe
(
enableJiraIssues
);
});
}
}
else
{
it
(
'
does not render checkbox and input field
'
,
()
=>
{
expect
(
findEnableCheckbox
().
exists
()).
toBe
(
false
);
expect
(
findProjectKey
().
exists
()).
toBe
(
false
);
});
it
(
'
renders the Premium CTA
'
,
()
=>
{
const
premiumUpgradeCTA
=
findPremiumUpgradeCTA
();
expect
(
premiumUpgradeCTA
.
exists
()).
toBe
(
true
);
expect
(
premiumUpgradeCTA
.
props
(
'
upgradePlanPath
'
)).
toBe
(
defaultProps
.
upgradePlanPath
);
});
}
expect
(
findPremiumUpgradeCTA
().
exists
()).
toBe
(
false
);
expect
(
findUltimateUpgradeCTA
().
exists
()).
toBe
(
enableJiraIssues
);
});
});
describe
(
'
when `showJiraIssuesIntegration` is true and `showJiraVulnerabilitiesIntegration` is true
'
,
()
=>
{
it
(
'
does not show any upgrade CTA
'
,
()
=>
{
createComponent
({
props
:
{
showJiraIssuesIntegration
:
true
,
showJiraVulnerabilitiesIntegration
:
true
},
it
(
'
does not render the Ultimate CTA
'
,
()
=>
{
expect
(
findUltimateUpgradeCTA
().
exists
()).
toBe
(
false
);
});
expect
(
findPremiumUpgradeCTA
().
exists
()).
toBe
(
false
);
expect
(
findUltimateUpgradeCTA
().
exists
()).
toBe
(
false
);
});
});
},
);
describe
(
'
Enable Jira issues checkbox
'
,
()
=>
{
beforeEach
(()
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment