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
594e8ae3
Commit
594e8ae3
authored
Mar 08, 2022
by
Justin Ho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add more specs for full coverage
parent
1c960d6a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
0 deletions
+49
-0
spec/frontend/integrations/edit/components/integration_form_spec.js
...end/integrations/edit/components/integration_form_spec.js
+23
-0
spec/models/integrations/jira_spec.rb
spec/models/integrations/jira_spec.rb
+26
-0
No files found.
spec/frontend/integrations/edit/components/integration_form_spec.js
View file @
594e8ae3
...
...
@@ -435,6 +435,29 @@ describe('IntegrationForm', () => {
});
},
);
describe
(
'
when IntegrationSectionConnection emits `request-jira-issue-types` event
'
,
()
=>
{
beforeEach
(()
=>
{
jest
.
spyOn
(
document
,
'
querySelector
'
).
mockReturnValue
(
document
.
createElement
(
'
form
'
));
createComponent
({
provide
:
{
glFeatures
:
{
integrationFormSections
:
true
},
},
customStateProps
:
{
sections
:
[
mockSectionConnection
],
testPath
:
'
/test
'
,
},
mountFn
:
mountExtended
,
});
findConnectionSectionComponent
().
vm
.
$emit
(
'
request-jira-issue-types
'
);
});
it
(
'
dispatches `requestJiraIssueTypes` action
'
,
()
=>
{
expect
(
dispatch
).
toHaveBeenCalledWith
(
'
requestJiraIssueTypes
'
,
expect
.
any
(
FormData
));
});
});
});
describe
(
'
ActiveCheckbox
'
,
()
=>
{
...
...
spec/models/integrations/jira_spec.rb
View file @
594e8ae3
...
...
@@ -109,6 +109,32 @@ RSpec.describe Integrations::Jira do
end
end
describe
'#sections'
do
let
(
:integration
)
{
create
(
:jira_integration
)
}
subject
(
:sections
)
{
integration
.
sections
.
map
{
|
s
|
s
[
:type
]
}
}
context
'when project_level? is true'
do
before
do
allow
(
integration
).
to
receive
(
:project_level?
).
and_return
(
true
)
end
it
'includes SECTION_TYPE_JIRA_ISSUES'
do
expect
(
sections
).
to
include
(
described_class
::
SECTION_TYPE_JIRA_ISSUES
)
end
end
context
'when project_level? is false'
do
before
do
allow
(
integration
).
to
receive
(
:project_level?
).
and_return
(
false
)
end
it
'does not include SECTION_TYPE_JIRA_ISSUES'
do
expect
(
sections
).
not_to
include
(
described_class
::
SECTION_TYPE_JIRA_ISSUES
)
end
end
end
describe
'.reference_pattern'
do
using
RSpec
::
Parameterized
::
TableSyntax
...
...
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