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
Boxiang Sun
gitlab-ce
Commits
bce89082
Commit
bce89082
authored
Jun 15, 2018
by
gfyoung
Committed by
Phil Hughes
Jun 15, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable no-restricted-globals in JS files
parent
72770e60
Changes
42
Hide whitespace changes
Inline
Side-by-side
Showing
42 changed files
with
55 additions
and
53 deletions
+55
-53
.eslintrc.yml
.eslintrc.yml
+0
-2
app/assets/javascripts/blob/viewer/index.js
app/assets/javascripts/blob/viewer/index.js
+1
-1
app/assets/javascripts/boards/components/board_delete.js
app/assets/javascripts/boards/components/board_delete.js
+1
-1
app/assets/javascripts/boards/stores/boards_store.js
app/assets/javascripts/boards/stores/boards_store.js
+1
-1
app/assets/javascripts/commits.js
app/assets/javascripts/commits.js
+1
-1
app/assets/javascripts/deploy_keys/components/app.vue
app/assets/javascripts/deploy_keys/components/app.vue
+1
-1
app/assets/javascripts/environments/components/environment_stop.vue
.../javascripts/environments/components/environment_stop.vue
+1
-1
app/assets/javascripts/ide/lib/diff/diff_worker.js
app/assets/javascripts/ide/lib/diff/diff_worker.js
+2
-0
app/assets/javascripts/ide/stores/workers/files_decorator_worker.js
.../javascripts/ide/stores/workers/files_decorator_worker.js
+2
-0
app/assets/javascripts/issue_show/components/app.vue
app/assets/javascripts/issue_show/components/app.vue
+1
-1
app/assets/javascripts/issue_show/components/edit_actions.vue
...assets/javascripts/issue_show/components/edit_actions.vue
+1
-1
app/assets/javascripts/issue_show/components/locked_warning.vue
...sets/javascripts/issue_show/components/locked_warning.vue
+1
-1
app/assets/javascripts/lazy_loader.js
app/assets/javascripts/lazy_loader.js
+2
-2
app/assets/javascripts/lib/utils/bootstrap_linked_tabs.js
app/assets/javascripts/lib/utils/bootstrap_linked_tabs.js
+1
-1
app/assets/javascripts/lib/utils/number_utils.js
app/assets/javascripts/lib/utils/number_utils.js
+1
-1
app/assets/javascripts/line_highlighter.js
app/assets/javascripts/line_highlighter.js
+2
-2
app/assets/javascripts/milestone.js
app/assets/javascripts/milestone.js
+2
-2
app/assets/javascripts/monitoring/components/graph/flag.vue
app/assets/javascripts/monitoring/components/graph/flag.vue
+1
-1
app/assets/javascripts/monitoring/utils/multiple_time_series.js
...sets/javascripts/monitoring/utils/multiple_time_series.js
+1
-1
app/assets/javascripts/notes.js
app/assets/javascripts/notes.js
+2
-2
app/assets/javascripts/notes/components/noteable_discussion.vue
...sets/javascripts/notes/components/noteable_discussion.vue
+1
-1
app/assets/javascripts/notes/components/noteable_note.vue
app/assets/javascripts/notes/components/noteable_note.vue
+2
-2
app/assets/javascripts/pages/users/user_tabs.js
app/assets/javascripts/pages/users/user_tabs.js
+1
-1
app/assets/javascripts/project_find_file.js
app/assets/javascripts/project_find_file.js
+1
-1
app/assets/javascripts/project_import.js
app/assets/javascripts/project_import.js
+1
-1
app/assets/javascripts/search_autocomplete.js
app/assets/javascripts/search_autocomplete.js
+1
-1
app/assets/javascripts/settings_panels.js
app/assets/javascripts/settings_panels.js
+2
-2
app/assets/javascripts/shortcuts_find_file.js
app/assets/javascripts/shortcuts_find_file.js
+2
-2
app/assets/javascripts/sidebar/components/confidential/confidential_issue_sidebar.vue
...ar/components/confidential/confidential_issue_sidebar.vue
+1
-1
app/assets/javascripts/sidebar/components/lock/lock_issue_sidebar.vue
...avascripts/sidebar/components/lock/lock_issue_sidebar.vue
+1
-1
app/assets/javascripts/sidebar/sidebar_mediator.js
app/assets/javascripts/sidebar/sidebar_mediator.js
+1
-1
app/assets/javascripts/snippet/snippet_embed.js
app/assets/javascripts/snippet/snippet_embed.js
+1
-1
spec/javascripts/blob/viewer/index_spec.js
spec/javascripts/blob/viewer/index_spec.js
+2
-2
spec/javascripts/bootstrap_linked_tabs_spec.js
spec/javascripts/bootstrap_linked_tabs_spec.js
+1
-1
spec/javascripts/commits_spec.js
spec/javascripts/commits_spec.js
+1
-1
spec/javascripts/environments/environments_app_spec.js
spec/javascripts/environments/environments_app_spec.js
+1
-1
spec/javascripts/environments/folder/environments_folder_view_spec.js
...ipts/environments/folder/environments_folder_view_spec.js
+1
-1
spec/javascripts/ide/stores/actions/file_spec.js
spec/javascripts/ide/stores/actions/file_spec.js
+2
-2
spec/javascripts/issue_show/components/app_spec.js
spec/javascripts/issue_show/components/app_spec.js
+2
-2
spec/javascripts/lib/utils/common_utils_spec.js
spec/javascripts/lib/utils/common_utils_spec.js
+2
-2
spec/javascripts/pipelines/pipelines_spec.js
spec/javascripts/pipelines/pipelines_spec.js
+1
-1
spec/javascripts/settings_panels_spec.js
spec/javascripts/settings_panels_spec.js
+2
-2
No files found.
.eslintrc.yml
View file @
bce89082
...
...
@@ -71,7 +71,5 @@ rules:
body
:
1
## Destructuring: https://eslint.org/docs/rules/prefer-destructuring
prefer-destructuring
:
off
## no-restricted-globals: https://eslint.org/docs/rules/no-restricted-globals
no-restricted-globals
:
off
## no-multi-assign: https://eslint.org/docs/rules/no-multi-assign
no-multi-assign
:
off
app/assets/javascripts/blob/viewer/index.js
View file @
bce89082
...
...
@@ -70,7 +70,7 @@ export default class BlobViewer {
const
initialViewer
=
this
.
$fileHolder
[
0
].
querySelector
(
'
.blob-viewer:not(.hidden)
'
);
let
initialViewerName
=
initialViewer
.
getAttribute
(
'
data-type
'
);
if
(
this
.
switcher
&&
location
.
hash
.
indexOf
(
'
#L
'
)
===
0
)
{
if
(
this
.
switcher
&&
window
.
location
.
hash
.
indexOf
(
'
#L
'
)
===
0
)
{
initialViewerName
=
'
simple
'
;
}
...
...
app/assets/javascripts/boards/components/board_delete.js
View file @
bce89082
...
...
@@ -17,7 +17,7 @@ gl.issueBoards.BoardDelete = Vue.extend({
deleteBoard
()
{
$
(
this
.
$el
).
tooltip
(
'
hide
'
);
if
(
confirm
(
'
Are you sure you want to delete this list?
'
))
{
if
(
window
.
confirm
(
'
Are you sure you want to delete this list?
'
))
{
this
.
list
.
destroy
();
}
}
...
...
app/assets/javascripts/boards/stores/boards_store.js
View file @
bce89082
...
...
@@ -145,6 +145,6 @@ gl.issueBoards.BoardsStore = {
return
filteredList
[
0
];
},
updateFiltersUrl
()
{
history
.
pushState
(
null
,
null
,
`?
${
this
.
filter
.
path
}
`
);
window
.
history
.
pushState
(
null
,
null
,
`?
${
this
.
filter
.
path
}
`
);
}
};
app/assets/javascripts/commits.js
View file @
bce89082
...
...
@@ -45,7 +45,7 @@ export default class CommitsList {
this
.
content
.
fadeTo
(
'
fast
'
,
1.0
);
// Change url so if user reload a page - search results are saved
history
.
replaceState
({
window
.
history
.
replaceState
({
page
:
commitsUrl
,
},
document
.
title
,
commitsUrl
);
})
...
...
app/assets/javascripts/deploy_keys/components/app.vue
View file @
bce89082
...
...
@@ -98,7 +98,7 @@ export default {
},
disableKey
(
deployKey
,
callback
)
{
// eslint-disable-next-line no-alert
if
(
confirm
(
s__
(
'
DeployKeys|You are going to remove this deploy key. Are you sure?
'
)))
{
if
(
window
.
confirm
(
s__
(
'
DeployKeys|You are going to remove this deploy key. Are you sure?
'
)))
{
this
.
service
.
disableKey
(
deployKey
.
id
)
.
then
(
this
.
fetchKeys
)
...
...
app/assets/javascripts/environments/components/environment_stop.vue
View file @
bce89082
...
...
@@ -40,7 +40,7 @@
methods
:
{
onClick
()
{
// eslint-disable-next-line no-alert
if
(
confirm
(
'
Are you sure you want to stop this environment?
'
))
{
if
(
window
.
confirm
(
'
Are you sure you want to stop this environment?
'
))
{
this
.
isLoading
=
true
;
$
(
this
.
$el
).
tooltip
(
'
dispose
'
);
...
...
app/assets/javascripts/ide/lib/diff/diff_worker.js
View file @
bce89082
import
{
computeDiff
}
from
'
./diff
'
;
// eslint-disable-next-line no-restricted-globals
self
.
addEventListener
(
'
message
'
,
(
e
)
=>
{
const
data
=
e
.
data
;
// eslint-disable-next-line no-restricted-globals
self
.
postMessage
({
path
:
data
.
path
,
changes
:
computeDiff
(
data
.
originalContent
,
data
.
newContent
),
...
...
app/assets/javascripts/ide/stores/workers/files_decorator_worker.js
View file @
bce89082
import
{
viewerInformationForPath
}
from
'
~/vue_shared/components/content_viewer/lib/viewer_utils
'
;
import
{
decorateData
,
sortTree
}
from
'
../utils
'
;
// eslint-disable-next-line no-restricted-globals
self
.
addEventListener
(
'
message
'
,
e
=>
{
const
{
data
,
projectId
,
branchId
,
tempFile
=
false
,
content
=
''
,
base64
=
false
}
=
e
.
data
;
...
...
@@ -89,6 +90,7 @@ self.addEventListener('message', e => {
return
acc
;
},
{});
// eslint-disable-next-line no-restricted-globals
self
.
postMessage
({
entries
,
treeList
:
sortTree
(
treeList
),
...
...
app/assets/javascripts/issue_show/components/app.vue
View file @
bce89082
...
...
@@ -226,7 +226,7 @@
.
then
(
res
=>
res
.
data
)
.
then
(
data
=>
this
.
checkForSpam
(
data
))
.
then
((
data
)
=>
{
if
(
location
.
pathname
!==
data
.
web_url
)
{
if
(
window
.
location
.
pathname
!==
data
.
web_url
)
{
visitUrl
(
data
.
web_url
);
}
...
...
app/assets/javascripts/issue_show/components/edit_actions.vue
View file @
bce89082
...
...
@@ -38,7 +38,7 @@
},
deleteIssuable
()
{
// eslint-disable-next-line no-alert
if
(
confirm
(
'
Issue will be removed! Are you sure?
'
))
{
if
(
window
.
confirm
(
'
Issue will be removed! Are you sure?
'
))
{
this
.
deleteLoading
=
true
;
eventHub
.
$emit
(
'
delete.issuable
'
);
...
...
app/assets/javascripts/issue_show/components/locked_warning.vue
View file @
bce89082
...
...
@@ -2,7 +2,7 @@
export
default
{
computed
:
{
currentPath
()
{
return
location
.
pathname
;
return
window
.
location
.
pathname
;
},
},
};
...
...
app/assets/javascripts/lazy_loader.js
View file @
bce89082
...
...
@@ -44,8 +44,8 @@ export default class LazyLoader {
requestAnimationFrame
(()
=>
this
.
checkElementsInView
());
}
checkElementsInView
()
{
const
scrollTop
=
pageYOffset
;
const
visHeight
=
scrollTop
+
innerHeight
+
SCROLL_THRESHOLD
;
const
scrollTop
=
window
.
pageYOffset
;
const
visHeight
=
scrollTop
+
window
.
innerHeight
+
SCROLL_THRESHOLD
;
// Loading Images which are in the current viewport or close to them
this
.
lazyImages
=
this
.
lazyImages
.
filter
((
selectedImage
)
=>
{
...
...
app/assets/javascripts/lib/utils/bootstrap_linked_tabs.js
View file @
bce89082
...
...
@@ -93,7 +93,7 @@ export default class LinkedTabs {
const
newState
=
`
${
copySource
}${
this
.
currentLocation
.
search
}${
this
.
currentLocation
.
hash
}
`
;
history
.
replaceState
({
window
.
history
.
replaceState
({
url
:
newState
,
},
document
.
title
,
newState
);
return
newState
;
...
...
app/assets/javascripts/lib/utils/number_utils.js
View file @
bce89082
...
...
@@ -12,7 +12,7 @@ export function formatRelevantDigits(number) {
let
digitsLeft
=
''
;
let
relevantDigits
=
0
;
let
formattedNumber
=
''
;
if
(
!
isNaN
(
Number
(
number
)))
{
if
(
!
Number
.
isNaN
(
Number
(
number
)))
{
digitsLeft
=
number
.
toString
().
split
(
'
.
'
)[
0
];
switch
(
digitsLeft
.
length
)
{
case
1
:
...
...
app/assets/javascripts/line_highlighter.js
View file @
bce89082
...
...
@@ -35,7 +35,7 @@ const LineHighlighter = function(options = {}) {
options
.
highlightLineClass
=
options
.
highlightLineClass
||
'
hll
'
;
options
.
fileHolderSelector
=
options
.
fileHolderSelector
||
'
.file-holder
'
;
options
.
scrollFileHolder
=
options
.
scrollFileHolder
||
false
;
options
.
hash
=
options
.
hash
||
location
.
hash
;
options
.
hash
=
options
.
hash
||
window
.
location
.
hash
;
this
.
options
=
options
;
this
.
_hash
=
options
.
hash
;
...
...
@@ -170,7 +170,7 @@ LineHighlighter.prototype.setHash = function(firstLineNumber, lastLineNumber) {
//
// This method is stubbed in tests.
LineHighlighter
.
prototype
.
__setLocationHash__
=
function
(
value
)
{
return
history
.
pushState
({
return
window
.
history
.
pushState
({
url
:
value
// We're using pushState instead of assigning location.hash directly to
// prevent the page from scrolling on the hashchange event
...
...
app/assets/javascripts/milestone.js
View file @
bce89082
...
...
@@ -18,13 +18,13 @@ export default class Milestone {
return
$
(
'
a[data-toggle="tab"]
'
).
on
(
'
show.bs.tab
'
,
(
e
)
=>
{
const
$target
=
$
(
e
.
target
);
location
.
hash
=
$target
.
attr
(
'
href
'
);
window
.
location
.
hash
=
$target
.
attr
(
'
href
'
);
this
.
loadTab
(
$target
);
});
}
// eslint-disable-next-line class-methods-use-this
loadInitialTab
()
{
const
$target
=
$
(
`.js-milestone-tabs a[href="
${
location
.
hash
}
"]`
);
const
$target
=
$
(
`.js-milestone-tabs a[href="
${
window
.
location
.
hash
}
"]`
);
if
(
$target
.
length
)
{
$target
.
tab
(
'
show
'
);
...
...
app/assets/javascripts/monitoring/components/graph/flag.vue
View file @
bce89082
...
...
@@ -97,7 +97,7 @@ export default {
?
this
.
deploymentFlagData
.
seriesIndex
:
indexFromCoordinates
;
const
value
=
series
.
values
[
index
]
&&
series
.
values
[
index
].
value
;
if
(
isNaN
(
value
))
{
if
(
Number
.
isNaN
(
value
))
{
return
'
-
'
;
}
return
`
${
formatRelevantDigits
(
value
)}${
this
.
unitOfDisplay
}
`
;
...
...
app/assets/javascripts/monitoring/utils/multiple_time_series.js
View file @
bce89082
...
...
@@ -73,7 +73,7 @@ function queryTimeSeries(query, graphWidth, graphHeight, graphHeightOffset, xDom
timeSeriesScaleX
.
ticks
(
d3
.
timeMinute
,
60
);
timeSeriesScaleY
.
domain
(
yDom
);
const
defined
=
d
=>
!
isNaN
(
d
.
value
)
&&
d
.
value
!=
null
;
const
defined
=
d
=>
!
Number
.
isNaN
(
d
.
value
)
&&
d
.
value
!=
null
;
const
lineFunction
=
d3
.
line
()
...
...
app/assets/javascripts/notes.js
View file @
bce89082
...
...
@@ -315,7 +315,7 @@ export default class Notes {
if
(
discussionNoteForm
.
length
)
{
if
(
$textarea
.
val
()
!==
''
)
{
if
(
!
confirm
(
'
Are you sure you want to cancel creating this comment?
'
)
!
window
.
confirm
(
'
Are you sure you want to cancel creating this comment?
'
)
)
{
return
;
}
...
...
@@ -329,7 +329,7 @@ export default class Notes {
newText
=
$textarea
.
val
();
if
(
originalText
!==
newText
)
{
if
(
!
confirm
(
'
Are you sure you want to cancel editing this comment?
'
)
!
window
.
confirm
(
'
Are you sure you want to cancel editing this comment?
'
)
)
{
return
;
}
...
...
app/assets/javascripts/notes/components/noteable_discussion.vue
View file @
bce89082
...
...
@@ -152,7 +152,7 @@ export default {
const
msg
=
'
Are you sure you want to cancel creating this comment?
'
;
// eslint-disable-next-line no-alert
if
(
!
confirm
(
msg
))
{
if
(
!
window
.
confirm
(
msg
))
{
return
;
}
}
...
...
app/assets/javascripts/notes/components/noteable_note.vue
View file @
bce89082
...
...
@@ -77,7 +77,7 @@ export default {
},
deleteHandler
()
{
// eslint-disable-next-line no-alert
if
(
confirm
(
'
Are you sure you want to delete this comment?
'
))
{
if
(
window
.
confirm
(
'
Are you sure you want to delete this comment?
'
))
{
this
.
isDeleting
=
true
;
this
.
deleteNote
(
this
.
note
)
...
...
@@ -129,7 +129,7 @@ export default {
formCancelHandler
(
shouldConfirm
,
isDirty
)
{
if
(
shouldConfirm
&&
isDirty
)
{
// eslint-disable-next-line no-alert
if
(
!
confirm
(
'
Are you sure you want to cancel editing this comment?
'
))
if
(
!
window
.
confirm
(
'
Are you sure you want to cancel editing this comment?
'
))
return
;
}
this
.
$refs
.
noteBody
.
resetAutoSave
();
...
...
app/assets/javascripts/pages/users/user_tabs.js
View file @
bce89082
...
...
@@ -187,7 +187,7 @@ export default class UserTabs {
let
newState
=
source
;
newState
=
newState
.
replace
(
/
\/
+$/
,
''
);
newState
+=
this
.
windowLocation
.
search
+
this
.
windowLocation
.
hash
;
history
.
replaceState
(
window
.
history
.
replaceState
(
{
url
:
newState
,
},
...
...
app/assets/javascripts/project_find_file.js
View file @
bce89082
...
...
@@ -150,7 +150,7 @@ export default class ProjectFindFile {
}
goToTree
()
{
return
location
.
href
=
this
.
options
.
treeUrl
;
return
window
.
location
.
href
=
this
.
options
.
treeUrl
;
}
goToBlob
()
{
...
...
app/assets/javascripts/project_import.js
View file @
bce89082
...
...
@@ -2,7 +2,7 @@ import { visitUrl } from './lib/utils/url_utility';
export
default
function
projectImport
()
{
setTimeout
(()
=>
{
visitUrl
(
location
.
href
);
visitUrl
(
window
.
location
.
href
);
},
5000
);
}
app/assets/javascripts/search_autocomplete.js
View file @
bce89082
...
...
@@ -438,7 +438,7 @@ export default class SearchAutocomplete {
}
onClick
(
item
,
$el
,
e
)
{
if
(
location
.
pathname
.
indexOf
(
item
.
url
)
!==
-
1
)
{
if
(
window
.
location
.
pathname
.
indexOf
(
item
.
url
)
!==
-
1
)
{
if
(
!
e
.
metaKey
)
e
.
preventDefault
();
if
(
!
this
.
badgePresent
)
{
if
(
item
.
category
===
'
Projects
'
)
{
...
...
app/assets/javascripts/settings_panels.js
View file @
bce89082
...
...
@@ -42,8 +42,8 @@ export default function initSettingsPanels() {
}
});
if
(
location
.
hash
)
{
const
$target
=
$
(
location
.
hash
);
if
(
window
.
location
.
hash
)
{
const
$target
=
$
(
window
.
location
.
hash
);
if
(
$target
.
length
&&
$target
.
hasClass
(
'
settings
'
))
{
expandSection
(
$target
);
}
...
...
app/assets/javascripts/shortcuts_find_file.js
View file @
bce89082
...
...
@@ -13,8 +13,8 @@ export default class ShortcutsFindFile extends ShortcutsNavigation {
element
===
this
.
projectFindFile
.
inputElement
[
0
]
&&
(
combo
===
'
up
'
||
combo
===
'
down
'
||
combo
===
'
esc
'
||
combo
===
'
enter
'
)
)
{
// when press up/down key in textbox, cusor prevent to move to home/end
e
vent
.
preventDefault
();
// when press up/down key in textbox, cu
r
sor prevent to move to home/end
e
.
preventDefault
();
return
false
;
}
...
...
app/assets/javascripts/sidebar/components/confidential/confidential_issue_sidebar.vue
View file @
bce89082
...
...
@@ -54,7 +54,7 @@ export default {
updateConfidentialAttribute
(
confidential
)
{
this
.
service
.
update
(
'
issue
'
,
{
confidential
})
.
then
(()
=>
location
.
reload
())
.
then
(()
=>
window
.
location
.
reload
())
.
catch
(()
=>
{
Flash
(
__
(
...
...
app/assets/javascripts/sidebar/components/lock/lock_issue_sidebar.vue
View file @
bce89082
...
...
@@ -76,7 +76,7 @@ export default {
.
update
(
this
.
issuableType
,
{
discussion_locked
:
locked
,
})
.
then
(()
=>
location
.
reload
())
.
then
(()
=>
window
.
location
.
reload
())
.
catch
(()
=>
Flash
(
this
.
__
(
...
...
app/assets/javascripts/sidebar/sidebar_mediator.js
View file @
bce89082
...
...
@@ -80,7 +80,7 @@ export default class SidebarMediator {
return
this
.
service
.
moveIssue
(
this
.
store
.
moveToProjectId
)
.
then
(
response
=>
response
.
json
())
.
then
((
data
)
=>
{
if
(
location
.
pathname
!==
data
.
web_url
)
{
if
(
window
.
location
.
pathname
!==
data
.
web_url
)
{
visitUrl
(
data
.
web_url
);
}
});
...
...
app/assets/javascripts/snippet/snippet_embed.js
View file @
bce89082
export
default
()
=>
{
const
{
protocol
,
host
,
pathname
}
=
location
;
const
{
protocol
,
host
,
pathname
}
=
window
.
location
;
const
shareBtn
=
document
.
querySelector
(
'
.js-share-btn
'
);
const
embedBtn
=
document
.
querySelector
(
'
.js-embed-btn
'
);
const
snippetUrlArea
=
document
.
querySelector
(
'
.js-snippet-url-area
'
);
...
...
spec/javascripts/blob/viewer/index_spec.js
View file @
bce89082
...
...
@@ -32,7 +32,7 @@ describe('Blob viewer', () => {
afterEach
(()
=>
{
mock
.
restore
();
location
.
hash
=
''
;
window
.
location
.
hash
=
''
;
});
it
(
'
loads source file after switching views
'
,
(
done
)
=>
{
...
...
@@ -49,7 +49,7 @@ describe('Blob viewer', () => {
});
it
(
'
loads source file when line number is in hash
'
,
(
done
)
=>
{
location
.
hash
=
'
#L1
'
;
window
.
location
.
hash
=
'
#L1
'
;
new
BlobViewer
();
...
...
spec/javascripts/bootstrap_linked_tabs_spec.js
View file @
bce89082
...
...
@@ -36,7 +36,7 @@ import LinkedTabs from '~/lib/utils/bootstrap_linked_tabs';
describe
(
'
on click
'
,
()
=>
{
it
(
'
should change the url according to the clicked tab
'
,
()
=>
{
const
historySpy
=
spyOn
(
history
,
'
replaceState
'
).
and
.
callFake
(()
=>
{});
const
historySpy
=
spyOn
(
window
.
history
,
'
replaceState
'
).
and
.
callFake
(()
=>
{});
const
linkedTabs
=
new
LinkedTabs
({
action
:
'
show
'
,
...
...
spec/javascripts/commits_spec.js
View file @
bce89082
...
...
@@ -56,7 +56,7 @@ describe('Commits List', () => {
beforeEach
(()
=>
{
commitsList
.
searchField
.
val
(
''
);
spyOn
(
history
,
'
replaceState
'
).
and
.
stub
();
spyOn
(
window
.
history
,
'
replaceState
'
).
and
.
stub
();
mock
=
new
MockAdapter
(
axios
);
mock
.
onGet
(
'
/h5bp/html5-boilerplate/commits/master
'
).
reply
(
200
,
{
...
...
spec/javascripts/environments/environments_app_spec.js
View file @
bce89082
...
...
@@ -220,7 +220,7 @@ describe('Environment', () => {
);
component
=
mountComponent
(
EnvironmentsComponent
,
mockData
);
spyOn
(
history
,
'
pushState
'
).
and
.
stub
();
spyOn
(
window
.
history
,
'
pushState
'
).
and
.
stub
();
});
describe
(
'
updateContent
'
,
()
=>
{
...
...
spec/javascripts/environments/folder/environments_folder_view_spec.js
View file @
bce89082
...
...
@@ -177,7 +177,7 @@ describe('Environments Folder View', () => {
});
component
=
mountComponent
(
Component
,
mockData
);
spyOn
(
history
,
'
pushState
'
).
and
.
stub
();
spyOn
(
window
.
history
,
'
pushState
'
).
and
.
stub
();
});
describe
(
'
updateContent
'
,
()
=>
{
...
...
spec/javascripts/ide/stores/actions/file_spec.js
View file @
bce89082
...
...
@@ -166,12 +166,12 @@ describe('IDE store file actions', () => {
});
it
(
'
resets location.hash for line highlighting
'
,
done
=>
{
location
.
hash
=
'
test
'
;
window
.
location
.
hash
=
'
test
'
;
store
.
dispatch
(
'
setFileActive
'
,
localFile
.
path
)
.
then
(()
=>
{
expect
(
location
.
hash
).
not
.
toBe
(
'
test
'
);
expect
(
window
.
location
.
hash
).
not
.
toBe
(
'
test
'
);
done
();
})
...
...
spec/javascripts/issue_show/components/app_spec.js
View file @
bce89082
...
...
@@ -145,7 +145,7 @@ describe('Issuable output', () => {
resolve
({
data
:
{
confidential
:
false
,
web_url
:
location
.
pathname
,
web_url
:
window
.
location
.
pathname
,
},
});
}));
...
...
@@ -177,7 +177,7 @@ describe('Issuable output', () => {
spyOn
(
vm
.
service
,
'
updateIssuable
'
).
and
.
callFake
(()
=>
new
Promise
((
resolve
)
=>
{
resolve
({
data
:
{
web_url
:
location
.
pathname
,
web_url
:
window
.
location
.
pathname
,
confidential
:
vm
.
isConfidential
,
},
});
...
...
spec/javascripts/lib/utils/common_utils_spec.js
View file @
bce89082
...
...
@@ -40,13 +40,13 @@ describe('common_utils', () => {
});
it
(
'
should decode params
'
,
()
=>
{
history
.
pushState
(
''
,
''
,
'
?label_name%5B%5D=test
'
);
window
.
history
.
pushState
(
''
,
''
,
'
?label_name%5B%5D=test
'
);
expect
(
commonUtils
.
getUrlParamsArray
()[
0
],
).
toBe
(
'
label_name[]=test
'
);
history
.
pushState
(
''
,
''
,
'
?
'
);
window
.
history
.
pushState
(
''
,
''
,
'
?
'
);
});
});
...
...
spec/javascripts/pipelines/pipelines_spec.js
View file @
bce89082
...
...
@@ -427,7 +427,7 @@ describe('Pipelines', () => {
describe
(
'
methods
'
,
()
=>
{
beforeEach
(()
=>
{
spyOn
(
history
,
'
pushState
'
).
and
.
stub
();
spyOn
(
window
.
history
,
'
pushState
'
).
and
.
stub
();
});
describe
(
'
updateContent
'
,
()
=>
{
...
...
spec/javascripts/settings_panels_spec.js
View file @
bce89082
...
...
@@ -9,11 +9,11 @@ describe('Settings Panels', () => {
describe
(
'
initSettingsPane
'
,
()
=>
{
afterEach
(()
=>
{
location
.
hash
=
''
;
window
.
location
.
hash
=
''
;
});
it
(
'
should expand linked hash fragment panel
'
,
()
=>
{
location
.
hash
=
'
#autodevops-settings
'
;
window
.
location
.
hash
=
'
#autodevops-settings
'
;
const
pipelineSettingsPanel
=
document
.
querySelector
(
'
#autodevops-settings
'
);
// Our test environment automatically expands everything so we need to clear that out first
...
...
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