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
Léo-Paul Géneau
gitlab-ce
Commits
1fc9262e
Commit
1fc9262e
authored
Jun 23, 2017
by
winh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle Promise rejections in mr_widget_pipeline_spec.js
parent
50fffb5f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
24 deletions
+35
-24
spec/javascripts/vue_mr_widget/components/mr_widget_pipeline_spec.js
...ripts/vue_mr_widget/components/mr_widget_pipeline_spec.js
+35
-24
No files found.
spec/javascripts/vue_mr_widget/components/mr_widget_pipeline_spec.js
View file @
1fc9262e
...
@@ -86,12 +86,15 @@ describe('MRWidgetPipeline', () => {
...
@@ -86,12 +86,15 @@ describe('MRWidgetPipeline', () => {
});
});
it
(
'
should render message with spinner
'
,
(
done
)
=>
{
it
(
'
should render message with spinner
'
,
(
done
)
=>
{
Vue
.
nextTick
(()
=>
{
Vue
.
nextTick
()
.
then
(()
=>
{
expect
(
el
.
querySelector
(
'
.pipeline-id
'
)).
toBe
(
null
);
expect
(
el
.
querySelector
(
'
.pipeline-id
'
)).
toBe
(
null
);
expect
(
el
.
innerText
.
trim
()).
toBe
(
'
Waiting for pipeline...
'
);
expect
(
el
.
innerText
.
trim
()).
toBe
(
'
Waiting for pipeline...
'
);
expect
(
el
.
querySelectorAll
(
'
i.fa.fa-spinner.fa-spin
'
).
length
).
toBe
(
1
);
expect
(
el
.
querySelectorAll
(
'
i.fa.fa-spinner.fa-spin
'
).
length
).
toBe
(
1
);
done
();
done
();
});
})
.
then
(
done
)
.
catch
(
done
.
fail
);
});
});
});
});
...
@@ -112,39 +115,47 @@ describe('MRWidgetPipeline', () => {
...
@@ -112,39 +115,47 @@ describe('MRWidgetPipeline', () => {
it
(
'
should list single stage
'
,
(
done
)
=>
{
it
(
'
should list single stage
'
,
(
done
)
=>
{
pipeline
.
details
.
stages
.
splice
(
0
,
1
);
pipeline
.
details
.
stages
.
splice
(
0
,
1
);
Vue
.
nextTick
(()
=>
{
Vue
.
nextTick
()
.
then
(()
=>
{
expect
(
el
.
querySelectorAll
(
'
.stage-container button
'
).
length
).
toEqual
(
1
);
expect
(
el
.
querySelectorAll
(
'
.stage-container button
'
).
length
).
toEqual
(
1
);
expect
(
el
.
innerText
).
toContain
(
'
with stage
'
);
expect
(
el
.
innerText
).
toContain
(
'
with stage
'
);
done
();
})
});
.
then
(
done
)
.
catch
(
done
.
fail
);
});
});
it
(
'
should not have stages when there is no stage
'
,
(
done
)
=>
{
it
(
'
should not have stages when there is no stage
'
,
(
done
)
=>
{
vm
.
mr
.
pipeline
.
details
.
stages
=
[];
vm
.
mr
.
pipeline
.
details
.
stages
=
[];
Vue
.
nextTick
(()
=>
{
Vue
.
nextTick
()
.
then
(()
=>
{
expect
(
el
.
querySelectorAll
(
'
.stage-container button
'
).
length
).
toEqual
(
0
);
expect
(
el
.
querySelectorAll
(
'
.stage-container button
'
).
length
).
toEqual
(
0
);
done
();
})
});
.
then
(
done
)
.
catch
(
done
.
fail
);
});
});
it
(
'
should not have coverage text when pipeline has no coverage info
'
,
(
done
)
=>
{
it
(
'
should not have coverage text when pipeline has no coverage info
'
,
(
done
)
=>
{
vm
.
mr
.
pipeline
.
coverage
=
null
;
vm
.
mr
.
pipeline
.
coverage
=
null
;
Vue
.
nextTick
(()
=>
{
Vue
.
nextTick
()
.
then
(()
=>
{
expect
(
el
.
querySelector
(
'
.js-mr-coverage
'
)).
toEqual
(
null
);
expect
(
el
.
querySelector
(
'
.js-mr-coverage
'
)).
toEqual
(
null
);
done
();
})
});
.
then
(
done
)
.
catch
(
done
.
fail
);
});
});
it
(
'
should show CI error when there is a CI error
'
,
(
done
)
=>
{
it
(
'
should show CI error when there is a CI error
'
,
(
done
)
=>
{
vm
.
mr
.
ciStatus
=
null
;
vm
.
mr
.
ciStatus
=
null
;
Vue
.
nextTick
(()
=>
{
Vue
.
nextTick
()
.
then
(()
=>
{
expect
(
el
.
querySelectorAll
(
'
.js-ci-error
'
).
length
).
toEqual
(
1
);
expect
(
el
.
querySelectorAll
(
'
.js-ci-error
'
).
length
).
toEqual
(
1
);
expect
(
el
.
innerText
).
toContain
(
'
Could not connect to the CI server
'
);
expect
(
el
.
innerText
).
toContain
(
'
Could not connect to the CI server
'
);
done
();
})
});
.
then
(
done
)
.
catch
(
done
.
fail
);
});
});
});
});
});
});
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