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
spec/frontend/shared/popover_spec.js
spec/frontend/shortcuts_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';
describe
(
'
Vuex ModalModule actions
'
,
()
=>
{
describe
(
'
open
'
,
()
=>
{
it
(
'
works
'
,
done
=>
{
it
(
'
works
'
,
(
done
)
=>
{
const
data
=
{
id
:
7
};
testAction
(
actions
.
open
,
data
,
{},
[{
type
:
types
.
OPEN
,
payload
:
data
}],
[],
done
);
...
...
@@ -12,19 +12,19 @@ describe('Vuex ModalModule actions', () => {
});
describe
(
'
close
'
,
()
=>
{
it
(
'
works
'
,
done
=>
{
it
(
'
works
'
,
(
done
)
=>
{
testAction
(
actions
.
close
,
null
,
{},
[{
type
:
types
.
CLOSE
}],
[],
done
);
});
});
describe
(
'
show
'
,
()
=>
{
it
(
'
works
'
,
done
=>
{
it
(
'
works
'
,
(
done
)
=>
{
testAction
(
actions
.
show
,
null
,
{},
[{
type
:
types
.
SHOW
}],
[],
done
);
});
});
describe
(
'
hide
'
,
()
=>
{
it
(
'
works
'
,
done
=>
{
it
(
'
works
'
,
(
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', () => {
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
;
await
wrapper
.
vm
.
$nextTick
();
...
...
@@ -183,7 +183,7 @@ describe('App', () => {
const
clickSecondTab
=
async
()
=>
{
const
secondTab
=
wrapper
.
findAll
(
'
.nav-link
'
).
at
(
1
);
await
secondTab
.
trigger
(
'
click
'
);
await
new
Promise
(
resolve
=>
requestAnimationFrame
(
resolve
));
await
new
Promise
(
(
resolve
)
=>
requestAnimationFrame
(
resolve
));
};
beforeEach
(()
=>
{
...
...
spec/frontend/wikis_spec.js
View file @
85af3689
...
...
@@ -5,7 +5,7 @@ import { setHTMLFixture } from './helpers/fixtures';
describe
(
'
Wikis
'
,
()
=>
{
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
'
:
''
}
">
<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', () => {
// Assert that +test is the only open 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
'
,
()
=>
{
...
...
spec/frontend_integration/test_helpers/fixtures.js
View file @
85af3689
...
...
@@ -10,9 +10,9 @@ const createFactoryWithDefault = (fn, defaultValue) => () => {
};
const
factory
=
{
json
:
fn
=>
createFactoryWithDefault
(
fn
,
{
error
:
'
fixture not found
'
}),
text
:
fn
=>
createFactoryWithDefault
(
fn
,
'
Hello world
\n
How are you today?
\n
'
),
binary
:
fn
=>
createFactoryWithDefault
(
fn
,
''
),
json
:
(
fn
)
=>
createFactoryWithDefault
(
fn
,
{
error
:
'
fixture not found
'
}),
text
:
(
fn
)
=>
createFactoryWithDefault
(
fn
,
'
Hello world
\n
How are you today?
\n
'
),
binary
:
(
fn
)
=>
createFactoryWithDefault
(
fn
,
''
),
};
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 = () => ({
},
seeds
(
schema
)
{
schema
.
db
.
loadData
({
files
:
getRepositoryFiles
().
map
(
path
=>
({
path
})),
files
:
getRepositoryFiles
().
map
(
(
path
)
=>
({
path
})),
projects
:
[
getProject
(),
getEmptyProject
()],
branches
:
[
getBranch
()],
mergeRequests
:
getMergeRequests
(),
...
...
spec/frontend_integration/test_helpers/mock_server/routes/404.js
View file @
85af3689
export
default
server
=>
{
[
'
get
'
,
'
post
'
,
'
put
'
,
'
delete
'
,
'
patch
'
].
forEach
(
method
=>
{
export
default
(
server
)
=>
{
[
'
get
'
,
'
post
'
,
'
put
'
,
'
delete
'
,
'
patch
'
].
forEach
(
(
method
)
=>
{
server
[
method
](
'
*
'
,
()
=>
{
return
new
Response
(
404
);
});
...
...
spec/frontend_integration/test_helpers/mock_server/routes/ci.js
View file @
85af3689
import
{
getPipelinesEmptyResponse
}
from
'
test_helpers/fixtures
'
;
export
default
server
=>
{
export
default
(
server
)
=>
{
server
.
get
(
'
*/commit/:id/pipelines
'
,
()
=>
{
return
getPipelinesEmptyResponse
();
});
...
...
spec/frontend_integration/test_helpers/mock_server/routes/graphql.js
View file @
85af3689
import
{
graphqlQuery
}
from
'
../graphql
'
;
export
default
server
=>
{
export
default
(
server
)
=>
{
server
.
post
(
'
/api/graphql
'
,
(
schema
,
request
)
=>
{
const
batches
=
JSON
.
parse
(
request
.
requestBody
);
...
...
spec/frontend_integration/test_helpers/mock_server/routes/index.js
View file @
85af3689
/* eslint-disable global-require */
export
default
server
=>
{
export
default
(
server
)
=>
{
[
require
(
'
./graphql
'
),
require
(
'
./projects
'
),
...
...
spec/frontend_integration/test_helpers/mock_server/routes/projects.js
View file @
85af3689
import
{
withKeys
}
from
'
test_helpers/utils/obj
'
;
export
default
server
=>
{
export
default
(
server
)
=>
{
server
.
get
(
'
/api/v4/projects/:id
'
,
(
schema
,
request
)
=>
{
const
{
id
}
=
request
.
params
;
...
...
spec/frontend_integration/test_helpers/mock_server/routes/repository.js
View file @
85af3689
import
{
createNewCommit
,
createCommitIdGenerator
}
from
'
test_helpers/factories
'
;
export
default
server
=>
{
export
default
(
server
)
=>
{
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
;
});
...
...
@@ -15,7 +15,7 @@ export default server => {
return
branch
.
attrs
;
});
server
.
get
(
'
*/-/files/:id
'
,
schema
=>
{
server
.
get
(
'
*/-/files/:id
'
,
(
schema
)
=>
{
return
schema
.
db
.
files
.
map
(({
path
})
=>
path
);
});
...
...
spec/frontend_integration/test_helpers/snapshot_serializer.js
View file @
85af3689
...
...
@@ -4,7 +4,7 @@ export default {
},
print
(
element
,
serialize
)
{
element
.
$_hit
=
true
;
element
.
querySelectorAll
(
'
[style]
'
).
forEach
(
el
=>
{
element
.
querySelectorAll
(
'
[style]
'
).
forEach
(
(
el
)
=>
{
el
.
$_hit
=
true
;
if
(
el
.
style
.
display
===
'
none
'
)
{
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', () => {
'
<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
);
expect
(
getHideSubItemsInterval
()).
toBe
(
0
);
...
...
@@ -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
({
clientX
:
el
.
getBoundingClientRect
().
left
,
clientY
:
el
.
getBoundingClientRect
().
top
,
...
...
spec/javascripts/lib/utils/browser_spec.js
View file @
85af3689
...
...
@@ -21,8 +21,8 @@ const PIXEL_TOLERANCE = 0.2;
* @param url
* @returns {Promise}
*/
const
urlToImage
=
url
=>
new
Promise
(
resolve
=>
{
const
urlToImage
=
(
url
)
=>
new
Promise
(
(
resolve
)
=>
{
const
img
=
new
Image
();
img
.
onload
=
function
()
{
resolve
(
img
);
...
...
@@ -64,10 +64,10 @@ describe('common_utils browser specific specs', () => {
});
describe
(
'
createOverlayIcon
'
,
()
=>
{
it
(
'
should return the favicon with the overlay
'
,
done
=>
{
it
(
'
should return the favicon with the overlay
'
,
(
done
)
=>
{
commonUtils
.
createOverlayIcon
(
faviconDataUrl
,
overlayDataUrl
)
.
then
(
url
=>
Promise
.
all
([
urlToImage
(
url
),
urlToImage
(
faviconWithOverlayDataUrl
)]))
.
then
(
(
url
)
=>
Promise
.
all
([
urlToImage
(
url
),
urlToImage
(
faviconWithOverlayDataUrl
)]))
.
then
(([
actual
,
expected
])
=>
{
expect
(
actual
).
toImageDiffEqual
(
expected
,
PIXEL_TOLERANCE
);
done
();
...
...
@@ -88,11 +88,11 @@ describe('common_utils browser specific specs', () => {
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
.
setFaviconOverlay
(
overlayDataUrl
)
.
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
])
=>
{
expect
(
actual
).
toImageDiffEqual
(
expected
,
PIXEL_TOLERANCE
);
done
();
...
...
@@ -119,7 +119,7 @@ describe('common_utils browser specific specs', () => {
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
);
commonUtils
.
setCiStatusFavicon
(
BUILD_URL
).
catch
(()
=>
{
...
...
@@ -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
,
{
favicon
:
overlayDataUrl
,
});
...
...
@@ -138,7 +138,7 @@ describe('common_utils browser specific specs', () => {
commonUtils
.
setCiStatusFavicon
(
BUILD_URL
)
.
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
])
=>
{
expect
(
actual
).
toImageDiffEqual
(
expected
,
PIXEL_TOLERANCE
);
done
();
...
...
spec/javascripts/matchers.js
View file @
85af3689
...
...
@@ -2,7 +2,7 @@ import pixelmatch from 'pixelmatch';
export
default
{
toImageDiffEqual
:
()
=>
{
const
getImageData
=
img
=>
{
const
getImageData
=
(
img
)
=>
{
const
canvas
=
document
.
createElement
(
'
canvas
'
);
canvas
.
width
=
img
.
width
;
canvas
.
height
=
img
.
height
;
...
...
spec/javascripts/test_bundle.js
View file @
85af3689
...
...
@@ -30,7 +30,7 @@ Vue.config.warnHandler = (msg, vm, trace) => {
const
currentStack
=
new
Error
().
stack
;
const
isInVueTestUtils
=
currentStack
.
split
(
'
\n
'
)
.
some
(
line
=>
line
.
startsWith
(
'
at VueWrapper.setProps (
'
));
.
some
(
(
line
)
=>
line
.
startsWith
(
'
at VueWrapper.setProps (
'
));
if
(
isInVueTestUtils
)
{
return
;
}
...
...
@@ -75,7 +75,7 @@ gon.relative_url_root = '';
let
hasUnhandledPromiseRejections
=
false
;
window
.
addEventListener
(
'
unhandledrejection
'
,
event
=>
{
window
.
addEventListener
(
'
unhandledrejection
'
,
(
event
)
=>
{
hasUnhandledPromiseRejections
=
true
;
console
.
error
(
'
Unhandled promise rejection:
'
);
console
.
error
(
event
.
reason
.
stack
||
event
.
reason
);
...
...
@@ -87,11 +87,11 @@ window.addEventListener('unhandledrejection', event => {
// enough for the socket to continue to communicate.
// The downside is that it creates a minor performance penalty in the time it takes
// to run our unit tests.
beforeEach
(
done
=>
done
());
beforeEach
(
(
done
)
=>
done
());
let
longRunningTestTimeoutHandle
;
beforeEach
(
done
=>
{
beforeEach
(
(
done
)
=>
{
longRunningTestTimeoutHandle
=
setTimeout
(()
=>
{
done
.
fail
(
'
Test is running too long!
'
);
},
4000
);
...
...
@@ -111,8 +111,8 @@ if (process.env.IS_EE) {
testContexts
.
push
(
require
.
context
(
'
ee_spec
'
,
true
,
/_spec$/
));
}
testContexts
.
forEach
(
context
=>
{
context
.
keys
().
forEach
(
path
=>
{
testContexts
.
forEach
(
(
context
)
=>
{
context
.
keys
().
forEach
(
(
path
)
=>
{
try
{
context
(
path
);
}
catch
(
err
)
{
...
...
@@ -128,7 +128,7 @@ testContexts.forEach(context => {
});
describe
(
'
test errors
'
,
()
=>
{
beforeAll
(
done
=>
{
beforeAll
(
(
done
)
=>
{
if
(
hasUnhandledPromiseRejections
||
hasVueWarnings
||
hasVueErrors
)
{
setTimeout
(
done
,
1000
);
}
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