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
a4640938
Commit
a4640938
authored
Dec 15, 2017
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix broken test mocking the wrong tool
parent
d2618d77
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
18 deletions
+9
-18
spec/javascripts/vue_mr_widget/ee_mr_widget_options_spec.js
spec/javascripts/vue_mr_widget/ee_mr_widget_options_spec.js
+9
-18
No files found.
spec/javascripts/vue_mr_widget/ee_mr_widget_options_spec.js
View file @
a4640938
...
...
@@ -382,6 +382,7 @@ describe('ee merge request widget options', () => {
describe
(
'
when it is loading
'
,
()
=>
{
it
(
'
should render loading indicator
'
,
()
=>
{
vm
=
mountComponent
(
Component
);
expect
(
vm
.
$el
.
querySelector
(
'
.js-docker-widget
'
).
textContent
.
trim
(),
).
toContain
(
'
Loading clair report
'
);
...
...
@@ -389,21 +390,16 @@ describe('ee merge request widget options', () => {
});
describe
(
'
with successful request
'
,
()
=>
{
const
interceptor
=
(
request
,
next
)
=>
{
if
(
request
.
url
===
'
clair.json
'
)
{
next
(
request
.
respondWith
(
JSON
.
stringify
(
dockerReport
),
{
status
:
200
,
}));
}
};
let
mock
;
beforeEach
(()
=>
{
Vue
.
http
.
interceptors
.
push
(
interceptor
);
mock
=
mock
=
new
MockAdapter
(
axios
);
mock
.
onGet
(
'
clair.json
'
).
reply
(
200
,
dockerReport
);
vm
=
mountComponent
(
Component
);
});
afterEach
(()
=>
{
Vue
.
http
.
interceptors
=
_
.
without
(
Vue
.
http
.
interceptors
,
interceptor
);
mock
.
reset
(
);
});
it
(
'
should render provided data
'
,
(
done
)
=>
{
...
...
@@ -433,21 +429,16 @@ describe('ee merge request widget options', () => {
});
describe
(
'
with failed request
'
,
()
=>
{
const
interceptor
=
(
request
,
next
)
=>
{
if
(
request
.
url
===
'
clair.json
'
)
{
next
(
request
.
respondWith
({},
{
status
:
500
,
}));
}
};
let
mock
;
beforeEach
(()
=>
{
Vue
.
http
.
interceptors
.
push
(
interceptor
);
mock
=
mock
=
new
MockAdapter
(
axios
);
mock
.
onGet
(
'
clair.json
'
).
reply
(
500
,
{});
vm
=
mountComponent
(
Component
);
});
afterEach
(()
=>
{
Vue
.
http
.
interceptors
=
_
.
without
(
Vue
.
http
.
interceptors
,
interceptor
);
mock
.
reset
(
);
});
it
(
'
should render error indicator
'
,
(
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