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
85af3689
Commit
85af3689
authored
Dec 23, 2020
by
Lukas Eipert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Run prettier on 17 files - 73 of 73
Part of our prettier migration; changing the arrow-parens style.
parent
325fb305
Changes
18
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
41 additions
and
60 deletions
+41
-60
.prettierignore
.prettierignore
+0
-19
spec/frontend/vuex_shared/modules/modal/actions_spec.js
spec/frontend/vuex_shared/modules/modal/actions_spec.js
+4
-4
spec/frontend/whats_new/components/app_spec.js
spec/frontend/whats_new/components/app_spec.js
+2
-2
spec/frontend/wikis_spec.js
spec/frontend/wikis_spec.js
+1
-1
spec/frontend_integration/ide/ide_integration_spec.js
spec/frontend_integration/ide/ide_integration_spec.js
+1
-1
spec/frontend_integration/test_helpers/fixtures.js
spec/frontend_integration/test_helpers/fixtures.js
+3
-3
spec/frontend_integration/test_helpers/mock_server/index.js
spec/frontend_integration/test_helpers/mock_server/index.js
+1
-1
spec/frontend_integration/test_helpers/mock_server/routes/404.js
...ontend_integration/test_helpers/mock_server/routes/404.js
+2
-2
spec/frontend_integration/test_helpers/mock_server/routes/ci.js
...rontend_integration/test_helpers/mock_server/routes/ci.js
+1
-1
spec/frontend_integration/test_helpers/mock_server/routes/graphql.js
...nd_integration/test_helpers/mock_server/routes/graphql.js
+1
-1
spec/frontend_integration/test_helpers/mock_server/routes/index.js
...tend_integration/test_helpers/mock_server/routes/index.js
+1
-1
spec/frontend_integration/test_helpers/mock_server/routes/projects.js
...d_integration/test_helpers/mock_server/routes/projects.js
+1
-1
spec/frontend_integration/test_helpers/mock_server/routes/repository.js
...integration/test_helpers/mock_server/routes/repository.js
+3
-3
spec/frontend_integration/test_helpers/snapshot_serializer.js
.../frontend_integration/test_helpers/snapshot_serializer.js
+1
-1
spec/javascripts/fly_out_nav_browser_spec.js
spec/javascripts/fly_out_nav_browser_spec.js
+2
-2
spec/javascripts/lib/utils/browser_spec.js
spec/javascripts/lib/utils/browser_spec.js
+9
-9
spec/javascripts/matchers.js
spec/javascripts/matchers.js
+1
-1
spec/javascripts/test_bundle.js
spec/javascripts/test_bundle.js
+7
-7
No files found.
.prettierignore
View file @
85af3689
...
@@ -2255,22 +2255,3 @@ spec/frontend/set_status_modal/set_status_modal_wrapper_spec.js
...
@@ -2255,22 +2255,3 @@ spec/frontend/set_status_modal/set_status_modal_wrapper_spec.js
spec/frontend/shared/popover_spec.js
spec/frontend/shared/popover_spec.js
spec/frontend/shortcuts_spec.js
spec/frontend/shortcuts_spec.js
spec/frontend/sidebar/assignee_title_spec.js
spec/frontend/sidebar/assignee_title_spec.js
## upbeat-elion
spec/frontend/vuex_shared/modules/modal/actions_spec.js
spec/frontend/whats_new/components/app_spec.js
spec/frontend/wikis_spec.js
spec/frontend_integration/ide/ide_integration_spec.js
spec/frontend_integration/test_helpers/fixtures.js
spec/frontend_integration/test_helpers/mock_server/index.js
spec/frontend_integration/test_helpers/mock_server/routes/404.js
spec/frontend_integration/test_helpers/mock_server/routes/ci.js
spec/frontend_integration/test_helpers/mock_server/routes/graphql.js
spec/frontend_integration/test_helpers/mock_server/routes/index.js
spec/frontend_integration/test_helpers/mock_server/routes/projects.js
spec/frontend_integration/test_helpers/mock_server/routes/repository.js
spec/frontend_integration/test_helpers/snapshot_serializer.js
spec/javascripts/fly_out_nav_browser_spec.js
spec/javascripts/lib/utils/browser_spec.js
spec/javascripts/matchers.js
spec/javascripts/test_bundle.js
spec/frontend/vuex_shared/modules/modal/actions_spec.js
View file @
85af3689
...
@@ -4,7 +4,7 @@ import * as actions from '~/vuex_shared/modules/modal/actions';
...
@@ -4,7 +4,7 @@ import * as actions from '~/vuex_shared/modules/modal/actions';
describe
(
'
Vuex ModalModule actions
'
,
()
=>
{
describe
(
'
Vuex ModalModule actions
'
,
()
=>
{
describe
(
'
open
'
,
()
=>
{
describe
(
'
open
'
,
()
=>
{
it
(
'
works
'
,
done
=>
{
it
(
'
works
'
,
(
done
)
=>
{
const
data
=
{
id
:
7
};
const
data
=
{
id
:
7
};
testAction
(
actions
.
open
,
data
,
{},
[{
type
:
types
.
OPEN
,
payload
:
data
}],
[],
done
);
testAction
(
actions
.
open
,
data
,
{},
[{
type
:
types
.
OPEN
,
payload
:
data
}],
[],
done
);
...
@@ -12,19 +12,19 @@ describe('Vuex ModalModule actions', () => {
...
@@ -12,19 +12,19 @@ describe('Vuex ModalModule actions', () => {
});
});
describe
(
'
close
'
,
()
=>
{
describe
(
'
close
'
,
()
=>
{
it
(
'
works
'
,
done
=>
{
it
(
'
works
'
,
(
done
)
=>
{
testAction
(
actions
.
close
,
null
,
{},
[{
type
:
types
.
CLOSE
}],
[],
done
);
testAction
(
actions
.
close
,
null
,
{},
[{
type
:
types
.
CLOSE
}],
[],
done
);
});
});
});
});
describe
(
'
show
'
,
()
=>
{
describe
(
'
show
'
,
()
=>
{
it
(
'
works
'
,
done
=>
{
it
(
'
works
'
,
(
done
)
=>
{
testAction
(
actions
.
show
,
null
,
{},
[{
type
:
types
.
SHOW
}],
[],
done
);
testAction
(
actions
.
show
,
null
,
{},
[{
type
:
types
.
SHOW
}],
[],
done
);
});
});
});
});
describe
(
'
hide
'
,
()
=>
{
describe
(
'
hide
'
,
()
=>
{
it
(
'
works
'
,
done
=>
{
it
(
'
works
'
,
(
done
)
=>
{
testAction
(
actions
.
hide
,
null
,
{},
[{
type
:
types
.
HIDE
}],
[],
done
);
testAction
(
actions
.
hide
,
null
,
{},
[{
type
:
types
.
HIDE
}],
[],
done
);
});
});
});
});
...
...
spec/frontend/whats_new/components/app_spec.js
View file @
85af3689
...
@@ -103,7 +103,7 @@ describe('App', () => {
...
@@ -103,7 +103,7 @@ describe('App', () => {
expect
(
actions
.
closeDrawer
).
toHaveBeenCalled
();
expect
(
actions
.
closeDrawer
).
toHaveBeenCalled
();
});
});
it
.
each
([
true
,
false
])(
'
passes open property
'
,
async
openState
=>
{
it
.
each
([
true
,
false
])(
'
passes open property
'
,
async
(
openState
)
=>
{
wrapper
.
vm
.
$store
.
state
.
open
=
openState
;
wrapper
.
vm
.
$store
.
state
.
open
=
openState
;
await
wrapper
.
vm
.
$nextTick
();
await
wrapper
.
vm
.
$nextTick
();
...
@@ -183,7 +183,7 @@ describe('App', () => {
...
@@ -183,7 +183,7 @@ describe('App', () => {
const
clickSecondTab
=
async
()
=>
{
const
clickSecondTab
=
async
()
=>
{
const
secondTab
=
wrapper
.
findAll
(
'
.nav-link
'
).
at
(
1
);
const
secondTab
=
wrapper
.
findAll
(
'
.nav-link
'
).
at
(
1
);
await
secondTab
.
trigger
(
'
click
'
);
await
secondTab
.
trigger
(
'
click
'
);
await
new
Promise
(
resolve
=>
requestAnimationFrame
(
resolve
));
await
new
Promise
(
(
resolve
)
=>
requestAnimationFrame
(
resolve
));
};
};
beforeEach
(()
=>
{
beforeEach
(()
=>
{
...
...
spec/frontend/wikis_spec.js
View file @
85af3689
...
@@ -5,7 +5,7 @@ import { setHTMLFixture } from './helpers/fixtures';
...
@@ -5,7 +5,7 @@ import { setHTMLFixture } from './helpers/fixtures';
describe
(
'
Wikis
'
,
()
=>
{
describe
(
'
Wikis
'
,
()
=>
{
describe
(
'
setting the commit message when the title changes
'
,
()
=>
{
describe
(
'
setting the commit message when the title changes
'
,
()
=>
{
const
editFormHtmlFixture
=
args
=>
`<form class="wiki-form
${
const
editFormHtmlFixture
=
(
args
)
=>
`<form class="wiki-form
${
args
.
newPage
?
'
js-new-wiki-page
'
:
''
args
.
newPage
?
'
js-new-wiki-page
'
:
''
}
">
}
">
<input type="text" id="wiki_title" value="My title" />
<input type="text" id="wiki_title" value="My title" />
...
...
spec/frontend_integration/ide/ide_integration_spec.js
View file @
85af3689
...
@@ -66,7 +66,7 @@ describe('WebIDE', () => {
...
@@ -66,7 +66,7 @@ describe('WebIDE', () => {
// Assert that +test is the only open tab
// Assert that +test is the only open tab
const
tabs
=
Array
.
from
(
document
.
querySelectorAll
(
'
.multi-file-tab
'
));
const
tabs
=
Array
.
from
(
document
.
querySelectorAll
(
'
.multi-file-tab
'
));
expect
(
tabs
.
map
(
x
=>
x
.
textContent
.
trim
())).
toEqual
([
'
+test
'
]);
expect
(
tabs
.
map
(
(
x
)
=>
x
.
textContent
.
trim
())).
toEqual
([
'
+test
'
]);
});
});
describe
(
'
editor info
'
,
()
=>
{
describe
(
'
editor info
'
,
()
=>
{
...
...
spec/frontend_integration/test_helpers/fixtures.js
View file @
85af3689
...
@@ -10,9 +10,9 @@ const createFactoryWithDefault = (fn, defaultValue) => () => {
...
@@ -10,9 +10,9 @@ const createFactoryWithDefault = (fn, defaultValue) => () => {
};
};
const
factory
=
{
const
factory
=
{
json
:
fn
=>
createFactoryWithDefault
(
fn
,
{
error
:
'
fixture not found
'
}),
json
:
(
fn
)
=>
createFactoryWithDefault
(
fn
,
{
error
:
'
fixture not found
'
}),
text
:
fn
=>
createFactoryWithDefault
(
fn
,
'
Hello world
\n
How are you today?
\n
'
),
text
:
(
fn
)
=>
createFactoryWithDefault
(
fn
,
'
Hello world
\n
How are you today?
\n
'
),
binary
:
fn
=>
createFactoryWithDefault
(
fn
,
''
),
binary
:
(
fn
)
=>
createFactoryWithDefault
(
fn
,
''
),
};
};
export
const
getProject
=
factory
.
json
(()
=>
require
(
'
test_fixtures/api/projects/get.json
'
));
export
const
getProject
=
factory
.
json
(()
=>
require
(
'
test_fixtures/api/projects/get.json
'
));
...
...
spec/frontend_integration/test_helpers/mock_server/index.js
View file @
85af3689
...
@@ -26,7 +26,7 @@ export const createMockServerOptions = () => ({
...
@@ -26,7 +26,7 @@ export const createMockServerOptions = () => ({
},
},
seeds
(
schema
)
{
seeds
(
schema
)
{
schema
.
db
.
loadData
({
schema
.
db
.
loadData
({
files
:
getRepositoryFiles
().
map
(
path
=>
({
path
})),
files
:
getRepositoryFiles
().
map
(
(
path
)
=>
({
path
})),
projects
:
[
getProject
(),
getEmptyProject
()],
projects
:
[
getProject
(),
getEmptyProject
()],
branches
:
[
getBranch
()],
branches
:
[
getBranch
()],
mergeRequests
:
getMergeRequests
(),
mergeRequests
:
getMergeRequests
(),
...
...
spec/frontend_integration/test_helpers/mock_server/routes/404.js
View file @
85af3689
export
default
server
=>
{
export
default
(
server
)
=>
{
[
'
get
'
,
'
post
'
,
'
put
'
,
'
delete
'
,
'
patch
'
].
forEach
(
method
=>
{
[
'
get
'
,
'
post
'
,
'
put
'
,
'
delete
'
,
'
patch
'
].
forEach
(
(
method
)
=>
{
server
[
method
](
'
*
'
,
()
=>
{
server
[
method
](
'
*
'
,
()
=>
{
return
new
Response
(
404
);
return
new
Response
(
404
);
});
});
...
...
spec/frontend_integration/test_helpers/mock_server/routes/ci.js
View file @
85af3689
import
{
getPipelinesEmptyResponse
}
from
'
test_helpers/fixtures
'
;
import
{
getPipelinesEmptyResponse
}
from
'
test_helpers/fixtures
'
;
export
default
server
=>
{
export
default
(
server
)
=>
{
server
.
get
(
'
*/commit/:id/pipelines
'
,
()
=>
{
server
.
get
(
'
*/commit/:id/pipelines
'
,
()
=>
{
return
getPipelinesEmptyResponse
();
return
getPipelinesEmptyResponse
();
});
});
...
...
spec/frontend_integration/test_helpers/mock_server/routes/graphql.js
View file @
85af3689
import
{
graphqlQuery
}
from
'
../graphql
'
;
import
{
graphqlQuery
}
from
'
../graphql
'
;
export
default
server
=>
{
export
default
(
server
)
=>
{
server
.
post
(
'
/api/graphql
'
,
(
schema
,
request
)
=>
{
server
.
post
(
'
/api/graphql
'
,
(
schema
,
request
)
=>
{
const
batches
=
JSON
.
parse
(
request
.
requestBody
);
const
batches
=
JSON
.
parse
(
request
.
requestBody
);
...
...
spec/frontend_integration/test_helpers/mock_server/routes/index.js
View file @
85af3689
/* eslint-disable global-require */
/* eslint-disable global-require */
export
default
server
=>
{
export
default
(
server
)
=>
{
[
[
require
(
'
./graphql
'
),
require
(
'
./graphql
'
),
require
(
'
./projects
'
),
require
(
'
./projects
'
),
...
...
spec/frontend_integration/test_helpers/mock_server/routes/projects.js
View file @
85af3689
import
{
withKeys
}
from
'
test_helpers/utils/obj
'
;
import
{
withKeys
}
from
'
test_helpers/utils/obj
'
;
export
default
server
=>
{
export
default
(
server
)
=>
{
server
.
get
(
'
/api/v4/projects/:id
'
,
(
schema
,
request
)
=>
{
server
.
get
(
'
/api/v4/projects/:id
'
,
(
schema
,
request
)
=>
{
const
{
id
}
=
request
.
params
;
const
{
id
}
=
request
.
params
;
...
...
spec/frontend_integration/test_helpers/mock_server/routes/repository.js
View file @
85af3689
import
{
createNewCommit
,
createCommitIdGenerator
}
from
'
test_helpers/factories
'
;
import
{
createNewCommit
,
createCommitIdGenerator
}
from
'
test_helpers/factories
'
;
export
default
server
=>
{
export
default
(
server
)
=>
{
const
commitIdGenerator
=
createCommitIdGenerator
();
const
commitIdGenerator
=
createCommitIdGenerator
();
server
.
get
(
'
/api/v4/projects/:id/repository/branches
'
,
schema
=>
{
server
.
get
(
'
/api/v4/projects/:id/repository/branches
'
,
(
schema
)
=>
{
return
schema
.
db
.
branches
;
return
schema
.
db
.
branches
;
});
});
...
@@ -15,7 +15,7 @@ export default server => {
...
@@ -15,7 +15,7 @@ export default server => {
return
branch
.
attrs
;
return
branch
.
attrs
;
});
});
server
.
get
(
'
*/-/files/:id
'
,
schema
=>
{
server
.
get
(
'
*/-/files/:id
'
,
(
schema
)
=>
{
return
schema
.
db
.
files
.
map
(({
path
})
=>
path
);
return
schema
.
db
.
files
.
map
(({
path
})
=>
path
);
});
});
...
...
spec/frontend_integration/test_helpers/snapshot_serializer.js
View file @
85af3689
...
@@ -4,7 +4,7 @@ export default {
...
@@ -4,7 +4,7 @@ export default {
},
},
print
(
element
,
serialize
)
{
print
(
element
,
serialize
)
{
element
.
$_hit
=
true
;
element
.
$_hit
=
true
;
element
.
querySelectorAll
(
'
[style]
'
).
forEach
(
el
=>
{
element
.
querySelectorAll
(
'
[style]
'
).
forEach
(
(
el
)
=>
{
el
.
$_hit
=
true
;
el
.
$_hit
=
true
;
if
(
el
.
style
.
display
===
'
none
'
)
{
if
(
el
.
style
.
display
===
'
none
'
)
{
el
.
textContent
=
'
(jest: contents hidden)
'
;
el
.
textContent
=
'
(jest: contents hidden)
'
;
...
...
spec/javascripts/fly_out_nav_browser_spec.js
View file @
85af3689
...
@@ -157,7 +157,7 @@ describe('Fly out sidebar navigation', () => {
...
@@ -157,7 +157,7 @@ describe('Fly out sidebar navigation', () => {
'
<div class="sidebar-sub-level-items" style="position: absolute; top: 0; left: 100px; height: 200px;"></div>
'
;
'
<div class="sidebar-sub-level-items" style="position: absolute; top: 0; left: 100px; height: 200px;"></div>
'
;
});
});
it
(
'
shows sub-items after 0ms if no menu is open
'
,
done
=>
{
it
(
'
shows sub-items after 0ms if no menu is open
'
,
(
done
)
=>
{
mouseEnterTopItems
(
el
);
mouseEnterTopItems
(
el
);
expect
(
getHideSubItemsInterval
()).
toBe
(
0
);
expect
(
getHideSubItemsInterval
()).
toBe
(
0
);
...
@@ -169,7 +169,7 @@ describe('Fly out sidebar navigation', () => {
...
@@ -169,7 +169,7 @@ describe('Fly out sidebar navigation', () => {
});
});
});
});
it
(
'
shows sub-items after 300ms if a menu is currently open
'
,
done
=>
{
it
(
'
shows sub-items after 300ms if a menu is currently open
'
,
(
done
)
=>
{
documentMouseMove
({
documentMouseMove
({
clientX
:
el
.
getBoundingClientRect
().
left
,
clientX
:
el
.
getBoundingClientRect
().
left
,
clientY
:
el
.
getBoundingClientRect
().
top
,
clientY
:
el
.
getBoundingClientRect
().
top
,
...
...
spec/javascripts/lib/utils/browser_spec.js
View file @
85af3689
...
@@ -21,8 +21,8 @@ const PIXEL_TOLERANCE = 0.2;
...
@@ -21,8 +21,8 @@ const PIXEL_TOLERANCE = 0.2;
* @param url
* @param url
* @returns {Promise}
* @returns {Promise}
*/
*/
const
urlToImage
=
url
=>
const
urlToImage
=
(
url
)
=>
new
Promise
(
resolve
=>
{
new
Promise
(
(
resolve
)
=>
{
const
img
=
new
Image
();
const
img
=
new
Image
();
img
.
onload
=
function
()
{
img
.
onload
=
function
()
{
resolve
(
img
);
resolve
(
img
);
...
@@ -64,10 +64,10 @@ describe('common_utils browser specific specs', () => {
...
@@ -64,10 +64,10 @@ describe('common_utils browser specific specs', () => {
});
});
describe
(
'
createOverlayIcon
'
,
()
=>
{
describe
(
'
createOverlayIcon
'
,
()
=>
{
it
(
'
should return the favicon with the overlay
'
,
done
=>
{
it
(
'
should return the favicon with the overlay
'
,
(
done
)
=>
{
commonUtils
commonUtils
.
createOverlayIcon
(
faviconDataUrl
,
overlayDataUrl
)
.
createOverlayIcon
(
faviconDataUrl
,
overlayDataUrl
)
.
then
(
url
=>
Promise
.
all
([
urlToImage
(
url
),
urlToImage
(
faviconWithOverlayDataUrl
)]))
.
then
(
(
url
)
=>
Promise
.
all
([
urlToImage
(
url
),
urlToImage
(
faviconWithOverlayDataUrl
)]))
.
then
(([
actual
,
expected
])
=>
{
.
then
(([
actual
,
expected
])
=>
{
expect
(
actual
).
toImageDiffEqual
(
expected
,
PIXEL_TOLERANCE
);
expect
(
actual
).
toImageDiffEqual
(
expected
,
PIXEL_TOLERANCE
);
done
();
done
();
...
@@ -88,11 +88,11 @@ describe('common_utils browser specific specs', () => {
...
@@ -88,11 +88,11 @@ describe('common_utils browser specific specs', () => {
document
.
body
.
removeChild
(
document
.
getElementById
(
'
favicon
'
));
document
.
body
.
removeChild
(
document
.
getElementById
(
'
favicon
'
));
});
});
it
(
'
should set page favicon to provided favicon overlay
'
,
done
=>
{
it
(
'
should set page favicon to provided favicon overlay
'
,
(
done
)
=>
{
commonUtils
commonUtils
.
setFaviconOverlay
(
overlayDataUrl
)
.
setFaviconOverlay
(
overlayDataUrl
)
.
then
(()
=>
document
.
getElementById
(
'
favicon
'
).
getAttribute
(
'
href
'
))
.
then
(()
=>
document
.
getElementById
(
'
favicon
'
).
getAttribute
(
'
href
'
))
.
then
(
url
=>
Promise
.
all
([
urlToImage
(
url
),
urlToImage
(
faviconWithOverlayDataUrl
)]))
.
then
(
(
url
)
=>
Promise
.
all
([
urlToImage
(
url
),
urlToImage
(
faviconWithOverlayDataUrl
)]))
.
then
(([
actual
,
expected
])
=>
{
.
then
(([
actual
,
expected
])
=>
{
expect
(
actual
).
toImageDiffEqual
(
expected
,
PIXEL_TOLERANCE
);
expect
(
actual
).
toImageDiffEqual
(
expected
,
PIXEL_TOLERANCE
);
done
();
done
();
...
@@ -119,7 +119,7 @@ describe('common_utils browser specific specs', () => {
...
@@ -119,7 +119,7 @@ describe('common_utils browser specific specs', () => {
document
.
body
.
removeChild
(
document
.
getElementById
(
'
favicon
'
));
document
.
body
.
removeChild
(
document
.
getElementById
(
'
favicon
'
));
});
});
it
(
'
should reset favicon in case of error
'
,
done
=>
{
it
(
'
should reset favicon in case of error
'
,
(
done
)
=>
{
mock
.
onGet
(
BUILD_URL
).
replyOnce
(
500
);
mock
.
onGet
(
BUILD_URL
).
replyOnce
(
500
);
commonUtils
.
setCiStatusFavicon
(
BUILD_URL
).
catch
(()
=>
{
commonUtils
.
setCiStatusFavicon
(
BUILD_URL
).
catch
(()
=>
{
...
@@ -130,7 +130,7 @@ describe('common_utils browser specific specs', () => {
...
@@ -130,7 +130,7 @@ describe('common_utils browser specific specs', () => {
});
});
});
});
it
(
'
should set page favicon to CI status favicon based on provided status
'
,
done
=>
{
it
(
'
should set page favicon to CI status favicon based on provided status
'
,
(
done
)
=>
{
mock
.
onGet
(
BUILD_URL
).
reply
(
200
,
{
mock
.
onGet
(
BUILD_URL
).
reply
(
200
,
{
favicon
:
overlayDataUrl
,
favicon
:
overlayDataUrl
,
});
});
...
@@ -138,7 +138,7 @@ describe('common_utils browser specific specs', () => {
...
@@ -138,7 +138,7 @@ describe('common_utils browser specific specs', () => {
commonUtils
commonUtils
.
setCiStatusFavicon
(
BUILD_URL
)
.
setCiStatusFavicon
(
BUILD_URL
)
.
then
(()
=>
document
.
getElementById
(
'
favicon
'
).
getAttribute
(
'
href
'
))
.
then
(()
=>
document
.
getElementById
(
'
favicon
'
).
getAttribute
(
'
href
'
))
.
then
(
url
=>
Promise
.
all
([
urlToImage
(
url
),
urlToImage
(
faviconWithOverlayDataUrl
)]))
.
then
(
(
url
)
=>
Promise
.
all
([
urlToImage
(
url
),
urlToImage
(
faviconWithOverlayDataUrl
)]))
.
then
(([
actual
,
expected
])
=>
{
.
then
(([
actual
,
expected
])
=>
{
expect
(
actual
).
toImageDiffEqual
(
expected
,
PIXEL_TOLERANCE
);
expect
(
actual
).
toImageDiffEqual
(
expected
,
PIXEL_TOLERANCE
);
done
();
done
();
...
...
spec/javascripts/matchers.js
View file @
85af3689
...
@@ -2,7 +2,7 @@ import pixelmatch from 'pixelmatch';
...
@@ -2,7 +2,7 @@ import pixelmatch from 'pixelmatch';
export
default
{
export
default
{
toImageDiffEqual
:
()
=>
{
toImageDiffEqual
:
()
=>
{
const
getImageData
=
img
=>
{
const
getImageData
=
(
img
)
=>
{
const
canvas
=
document
.
createElement
(
'
canvas
'
);
const
canvas
=
document
.
createElement
(
'
canvas
'
);
canvas
.
width
=
img
.
width
;
canvas
.
width
=
img
.
width
;
canvas
.
height
=
img
.
height
;
canvas
.
height
=
img
.
height
;
...
...
spec/javascripts/test_bundle.js
View file @
85af3689
...
@@ -30,7 +30,7 @@ Vue.config.warnHandler = (msg, vm, trace) => {
...
@@ -30,7 +30,7 @@ Vue.config.warnHandler = (msg, vm, trace) => {
const
currentStack
=
new
Error
().
stack
;
const
currentStack
=
new
Error
().
stack
;
const
isInVueTestUtils
=
currentStack
const
isInVueTestUtils
=
currentStack
.
split
(
'
\n
'
)
.
split
(
'
\n
'
)
.
some
(
line
=>
line
.
startsWith
(
'
at VueWrapper.setProps (
'
));
.
some
(
(
line
)
=>
line
.
startsWith
(
'
at VueWrapper.setProps (
'
));
if
(
isInVueTestUtils
)
{
if
(
isInVueTestUtils
)
{
return
;
return
;
}
}
...
@@ -75,7 +75,7 @@ gon.relative_url_root = '';
...
@@ -75,7 +75,7 @@ gon.relative_url_root = '';
let
hasUnhandledPromiseRejections
=
false
;
let
hasUnhandledPromiseRejections
=
false
;
window
.
addEventListener
(
'
unhandledrejection
'
,
event
=>
{
window
.
addEventListener
(
'
unhandledrejection
'
,
(
event
)
=>
{
hasUnhandledPromiseRejections
=
true
;
hasUnhandledPromiseRejections
=
true
;
console
.
error
(
'
Unhandled promise rejection:
'
);
console
.
error
(
'
Unhandled promise rejection:
'
);
console
.
error
(
event
.
reason
.
stack
||
event
.
reason
);
console
.
error
(
event
.
reason
.
stack
||
event
.
reason
);
...
@@ -87,11 +87,11 @@ window.addEventListener('unhandledrejection', event => {
...
@@ -87,11 +87,11 @@ window.addEventListener('unhandledrejection', event => {
// enough for the socket to continue to communicate.
// enough for the socket to continue to communicate.
// The downside is that it creates a minor performance penalty in the time it takes
// The downside is that it creates a minor performance penalty in the time it takes
// to run our unit tests.
// to run our unit tests.
beforeEach
(
done
=>
done
());
beforeEach
(
(
done
)
=>
done
());
let
longRunningTestTimeoutHandle
;
let
longRunningTestTimeoutHandle
;
beforeEach
(
done
=>
{
beforeEach
(
(
done
)
=>
{
longRunningTestTimeoutHandle
=
setTimeout
(()
=>
{
longRunningTestTimeoutHandle
=
setTimeout
(()
=>
{
done
.
fail
(
'
Test is running too long!
'
);
done
.
fail
(
'
Test is running too long!
'
);
},
4000
);
},
4000
);
...
@@ -111,8 +111,8 @@ if (process.env.IS_EE) {
...
@@ -111,8 +111,8 @@ if (process.env.IS_EE) {
testContexts
.
push
(
require
.
context
(
'
ee_spec
'
,
true
,
/_spec$/
));
testContexts
.
push
(
require
.
context
(
'
ee_spec
'
,
true
,
/_spec$/
));
}
}
testContexts
.
forEach
(
context
=>
{
testContexts
.
forEach
(
(
context
)
=>
{
context
.
keys
().
forEach
(
path
=>
{
context
.
keys
().
forEach
(
(
path
)
=>
{
try
{
try
{
context
(
path
);
context
(
path
);
}
catch
(
err
)
{
}
catch
(
err
)
{
...
@@ -128,7 +128,7 @@ testContexts.forEach(context => {
...
@@ -128,7 +128,7 @@ testContexts.forEach(context => {
});
});
describe
(
'
test errors
'
,
()
=>
{
describe
(
'
test errors
'
,
()
=>
{
beforeAll
(
done
=>
{
beforeAll
(
(
done
)
=>
{
if
(
hasUnhandledPromiseRejections
||
hasVueWarnings
||
hasVueErrors
)
{
if
(
hasUnhandledPromiseRejections
||
hasVueWarnings
||
hasVueErrors
)
{
setTimeout
(
done
,
1000
);
setTimeout
(
done
,
1000
);
}
else
{
}
else
{
...
...
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