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
d7403c3f
Commit
d7403c3f
authored
Feb 27, 2020
by
Maxime Orefice
Committed by
Paul Slaughter
Feb 27, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix junit test tab if no test reports
parent
46eb6ce2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
12 deletions
+26
-12
app/assets/javascripts/pipelines/pipeline_details_bundle.js
app/assets/javascripts/pipelines/pipeline_details_bundle.js
+4
-0
spec/features/projects/pipelines/pipeline_spec.rb
spec/features/projects/pipelines/pipeline_spec.rb
+22
-12
No files found.
app/assets/javascripts/pipelines/pipeline_details_bundle.js
View file @
d7403c3f
...
...
@@ -134,6 +134,10 @@ export default () => {
axios
.
get
(
dataset
.
testReportsCountEndpoint
)
.
then
(({
data
})
=>
{
if
(
!
data
.
total_count
)
{
return
;
}
document
.
querySelector
(
'
.js-test-report-badge-counter
'
).
innerHTML
=
data
.
total_count
;
})
.
catch
(()
=>
{});
...
...
spec/features/projects/pipelines/pipeline_spec.rb
View file @
d7403c3f
...
...
@@ -356,7 +356,7 @@ describe 'Pipeline', :js do
end
end
context
'test tabs'
do
describe
'test tabs'
do
let
(
:pipeline
)
{
create
(
:ci_pipeline
,
:with_test_reports
,
project:
project
)
}
before
do
...
...
@@ -364,21 +364,31 @@ describe 'Pipeline', :js do
wait_for_requests
end
it
'shows badge counter in Tests tab'
do
expect
(
pipeline
.
test_reports
.
total_count
).
to
eq
(
4
)
expect
(
page
.
find
(
'.js-test-report-badge-counter'
).
text
).
to
eq
(
pipeline
.
test_reports
.
total_count
.
to_s
)
end
context
'with test reports'
do
it
'shows badge counter in Tests tab'
do
expect
(
pipeline
.
test_reports
.
total_count
).
to
eq
(
4
)
expect
(
page
.
find
(
'.js-test-report-badge-counter'
).
text
).
to
eq
(
pipeline
.
test_reports
.
total_count
.
to_s
)
end
it
'does not call test_report.json endpoint by default'
,
:js
do
expect
(
page
).
to
have_selector
(
'.js-no-tests-to-show'
,
visible: :all
)
end
it
'does not call test_report.json endpoint by default'
,
:js
do
expect
(
page
).
to
have_selector
(
'.js-no-tests-to-show'
,
visible: :all
)
it
'does call test_report.json endpoint when tab is selected'
,
:js
do
find
(
'.js-tests-tab-link'
).
click
wait_for_requests
expect
(
page
).
to
have_content
(
'Test suites'
)
expect
(
page
).
to
have_selector
(
'.js-tests-detail'
,
visible: :all
)
end
end
it
'does call test_report.json endpoint when tab is selected'
,
:js
do
find
(
'.js-tests-tab-link'
).
click
wait_for_requests
context
'without test reports'
do
let
(
:pipeline
)
{
create
(
:ci_pipeline
,
project:
project
)
}
expect
(
page
).
to
have_content
(
'Test suites'
)
expect
(
page
).
to
have_selector
(
'.js-tests-detail'
,
visible: :all
)
it
'shows nothing'
do
expect
(
page
.
find
(
'.js-test-report-badge-counter'
,
visible: :all
).
text
).
to
eq
(
""
)
end
end
end
...
...
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