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
6bddb9d7
Commit
6bddb9d7
authored
Jul 10, 2020
by
mfluharty
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add tests for parsing incomplete issues
parent
88d5be02
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
58 additions
and
0 deletions
+58
-0
spec/frontend/reports/codequality_report/store/utils/codequality_comparison_spec.js
...quality_report/store/utils/codequality_comparison_spec.js
+58
-0
No files found.
spec/frontend/reports/codequality_report/store/utils/codequality_comparison_spec.js
View file @
6bddb9d7
...
...
@@ -37,6 +37,64 @@ describe('Codequality report store utils', () => {
expect
(
result
.
path
).
toEqual
(
baseIssues
[
0
].
location
.
path
);
expect
(
result
.
line
).
toEqual
(
baseIssues
[
0
].
location
.
lines
.
begin
);
});
describe
(
'
when an issue has no location or path
'
,
()
=>
{
const
issue
=
{
description
:
'
Insecure Dependency
'
};
beforeEach
(()
=>
{
[
result
]
=
parseCodeclimateMetrics
([
issue
],
'
path
'
);
});
it
(
'
is parsed
'
,
()
=>
{
expect
(
result
.
name
).
toEqual
(
issue
.
description
);
});
});
describe
(
'
when an issue has a path but no line
'
,
()
=>
{
const
issue
=
{
description
:
'
Insecure Dependency
'
,
location
:
{
path
:
'
Gemfile.lock
'
}
};
beforeEach
(()
=>
{
[
result
]
=
parseCodeclimateMetrics
([
issue
],
'
path
'
);
});
it
(
'
is parsed
'
,
()
=>
{
expect
(
result
.
name
).
toEqual
(
issue
.
description
);
expect
(
result
.
path
).
toEqual
(
issue
.
location
.
path
);
expect
(
result
.
urlPath
).
toEqual
(
`path/
${
issue
.
location
.
path
}
`
);
});
});
describe
(
'
when an issue has a line nested in positions
'
,
()
=>
{
const
issue
=
{
description
:
'
Insecure Dependency
'
,
location
:
{
path
:
'
Gemfile.lock
'
,
positions
:
{
begin
:
{
line
:
84
}
},
},
};
beforeEach
(()
=>
{
[
result
]
=
parseCodeclimateMetrics
([
issue
],
'
path
'
);
});
it
(
'
is parsed
'
,
()
=>
{
expect
(
result
.
name
).
toEqual
(
issue
.
description
);
expect
(
result
.
path
).
toEqual
(
issue
.
location
.
path
);
expect
(
result
.
urlPath
).
toEqual
(
`path/
${
issue
.
location
.
path
}
#L
${
issue
.
location
.
positions
.
begin
.
line
}
`
,
);
});
});
describe
(
'
with an empty issue array
'
,
()
=>
{
beforeEach
(()
=>
{
result
=
parseCodeclimateMetrics
([],
'
path
'
);
});
it
(
'
returns an empty array
'
,
()
=>
{
expect
(
result
).
toEqual
([]);
});
});
});
describe
(
'
doCodeClimateComparison
'
,
()
=>
{
...
...
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