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
0
Merge Requests
0
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
Jérome Perrin
gitlab-ce
Commits
9786e4fb
Commit
9786e4fb
authored
Jul 06, 2017
by
Kamil Trzciński
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Merge branch 'winh-mr-widget-no-pipeline' into 'master'"
This reverts merge request !12127
parent
050eae8c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
56 deletions
+19
-56
app/assets/javascripts/vue_merge_request_widget/components/mr_widget_pipeline.js
...vue_merge_request_widget/components/mr_widget_pipeline.js
+1
-8
spec/javascripts/vue_mr_widget/components/mr_widget_pipeline_spec.js
...ripts/vue_mr_widget/components/mr_widget_pipeline_spec.js
+18
-48
No files found.
app/assets/javascripts/vue_merge_request_widget/components/mr_widget_pipeline.js
View file @
9786e4fb
...
...
@@ -17,9 +17,6 @@ export default {
return
hasCI
&&
!
ciStatus
;
},
hasPipeline
()
{
return
Object
.
keys
(
this
.
mr
.
pipeline
||
{}).
length
>
0
;
},
svg
()
{
return
statusIconEntityMap
.
icon_status_failed
;
},
...
...
@@ -33,11 +30,7 @@ export default {
template
:
`
<div class="mr-widget-heading">
<div class="ci-widget">
<template v-if="!hasPipeline">
<i class="fa fa-spinner fa-spin append-right-10" aria-hidden="true"></i>
Waiting for pipeline...
</template>
<template v-else-if="hasCIError">
<template v-if="hasCIError">
<div class="ci-status-icon ci-status-icon-failed ci-error js-ci-error">
<span class="js-icon-link icon-link">
<span
...
...
spec/javascripts/vue_mr_widget/components/mr_widget_pipeline_spec.js
View file @
9786e4fb
...
...
@@ -76,28 +76,6 @@ describe('MRWidgetPipeline', () => {
el
=
vm
.
$el
;
});
afterEach
(()
=>
{
vm
.
$destroy
();
});
describe
(
'
without a pipeline
'
,
()
=>
{
beforeEach
(()
=>
{
vm
.
mr
=
{
pipeline
:
null
};
});
it
(
'
should render message with spinner
'
,
(
done
)
=>
{
Vue
.
nextTick
()
.
then
(()
=>
{
expect
(
el
.
querySelector
(
'
.pipeline-id
'
)).
toBe
(
null
);
expect
(
el
.
innerText
.
trim
()).
toBe
(
'
Waiting for pipeline...
'
);
expect
(
el
.
querySelectorAll
(
'
i.fa.fa-spinner.fa-spin
'
).
length
).
toBe
(
1
);
done
();
})
.
then
(
done
)
.
catch
(
done
.
fail
);
});
});
it
(
'
should render template elements correctly
'
,
()
=>
{
expect
(
el
.
classList
.
contains
(
'
mr-widget-heading
'
)).
toBeTruthy
();
expect
(
el
.
querySelectorAll
(
'
.ci-status-icon.ci-status-icon-success
'
).
length
).
toEqual
(
1
);
...
...
@@ -115,47 +93,39 @@ describe('MRWidgetPipeline', () => {
it
(
'
should list single stage
'
,
(
done
)
=>
{
pipeline
.
details
.
stages
.
splice
(
0
,
1
);
Vue
.
nextTick
()
.
then
(()
=>
{
Vue
.
nextTick
(()
=>
{
expect
(
el
.
querySelectorAll
(
'
.stage-container button
'
).
length
).
toEqual
(
1
);
expect
(
el
.
innerText
).
toContain
(
'
with stage
'
);
})
.
then
(
done
)
.
catch
(
done
.
fail
);
done
();
});
});
it
(
'
should not have stages when there is no stage
'
,
(
done
)
=>
{
vm
.
mr
.
pipeline
.
details
.
stages
=
[];
Vue
.
nextTick
()
.
then
(()
=>
{
Vue
.
nextTick
(()
=>
{
expect
(
el
.
querySelectorAll
(
'
.stage-container button
'
).
length
).
toEqual
(
0
);
})
.
then
(
done
)
.
catch
(
done
.
fail
);
done
();
});
});
it
(
'
should not have coverage text when pipeline has no coverage info
'
,
(
done
)
=>
{
vm
.
mr
.
pipeline
.
coverage
=
null
;
Vue
.
nextTick
()
.
then
(()
=>
{
Vue
.
nextTick
(()
=>
{
expect
(
el
.
querySelector
(
'
.js-mr-coverage
'
)).
toEqual
(
null
);
})
.
then
(
done
)
.
catch
(
done
.
fail
);
done
();
});
});
it
(
'
should show CI error when there is a CI error
'
,
(
done
)
=>
{
vm
.
mr
.
ciStatus
=
null
;
Vue
.
nextTick
()
.
then
(()
=>
{
Vue
.
nextTick
(()
=>
{
expect
(
el
.
querySelectorAll
(
'
.js-ci-error
'
).
length
).
toEqual
(
1
);
expect
(
el
.
innerText
).
toContain
(
'
Could not connect to the CI server
'
);
})
.
then
(
done
)
.
catch
(
done
.
fail
);
done
();
});
});
});
});
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