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
87e532b9
Commit
87e532b9
authored
Dec 23, 2020
by
Lukas Eipert
Committed by
Paul Slaughter
Jan 07, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix mr_widget_options_spec
parent
98cf4df5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
14 deletions
+10
-14
spec/frontend/vue_mr_widget/mr_widget_options_spec.js
spec/frontend/vue_mr_widget/mr_widget_options_spec.js
+10
-14
No files found.
spec/frontend/vue_mr_widget/mr_widget_options_spec.js
View file @
87e532b9
...
...
@@ -7,6 +7,7 @@ import mrWidgetOptions from '~/vue_merge_request_widget/mr_widget_options.vue';
import
eventHub
from
'
~/vue_merge_request_widget/event_hub
'
;
import
notify
from
'
~/lib/utils/notify
'
;
import
SmartInterval
from
'
~/smart_interval
'
;
import
{
setFaviconOverlay
}
from
'
~/lib/utils/favicon
'
;
import
{
stateKey
}
from
'
~/vue_merge_request_widget/stores/state_maps
'
;
import
mockData
from
'
./mock_data
'
;
import
{
faviconDataUrl
,
overlayDataUrl
}
from
'
../lib/utils/mock_data
'
;
...
...
@@ -14,6 +15,8 @@ import { SUCCESS } from '~/vue_merge_request_widget/components/deployment/consta
jest
.
mock
(
'
~/smart_interval
'
);
jest
.
mock
(
'
~/lib/utils/favicon
'
)
const
returnPromise
=
(
data
)
=>
new
Promise
((
resolve
)
=>
{
resolve
({
...
...
@@ -421,21 +424,14 @@ describe('mrWidgetOptions', () => {
document
.
body
.
removeChild
(
document
.
getElementById
(
'
favicon
'
));
});
it
(
'
should call setFavicon method
'
,
(
done
)
=>
{
it
(
'
should call setFavicon method
'
,
async
(
)
=>
{
vm
.
mr
.
ciStatusFaviconPath
=
overlayDataUrl
;
vm
.
setFaviconHelper
()
.
then
(()
=>
{
/*
It would be better if we'd could mock commonUtils.setFaviconURL
with a spy and test that it was called. We are doing the following
tests as a proxy to show that the function has been called
*/
expect
(
faviconElement
.
getAttribute
(
'
href
'
)).
not
.
toEqual
(
null
);
expect
(
faviconElement
.
getAttribute
(
'
href
'
)).
not
.
toEqual
(
overlayDataUrl
);
expect
(
faviconElement
.
getAttribute
(
'
href
'
)).
not
.
toEqual
(
faviconDataUrl
);
})
.
then
(
done
)
.
catch
(
done
.
fail
);
await
vm
.
setFaviconHelper
()
expect
(
setFaviconOverlay
).
toHaveBeenCalledWith
(
overlayDataUrl
);
});
it
(
'
should not call setFavicon when there is no ciStatusFaviconPath
'
,
(
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