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
9180eaee
Commit
9180eaee
authored
Dec 23, 2020
by
Lukas Eipert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Run prettier on 31 files - 57 of 73
Part of our prettier migration; changing the arrow-parens style.
parent
0fdc1fc0
Changes
32
Hide whitespace changes
Inline
Side-by-side
Showing
32 changed files
with
123 additions
and
156 deletions
+123
-156
.prettierignore
.prettierignore
+0
-33
spec/frontend/droplab/drop_down_spec.js
spec/frontend/droplab/drop_down_spec.js
+4
-4
spec/frontend/droplab/plugins/ajax_filter_spec.js
spec/frontend/droplab/plugins/ajax_filter_spec.js
+6
-6
spec/frontend/editor/editor_lite_extension_base_spec.js
spec/frontend/editor/editor_lite_extension_base_spec.js
+1
-1
spec/frontend/editor/editor_lite_spec.js
spec/frontend/editor/editor_lite_spec.js
+6
-6
spec/frontend/editor/editor_markdown_ext_spec.js
spec/frontend/editor/editor_markdown_ext_spec.js
+1
-1
spec/frontend/emoji/emoji_spec.js
spec/frontend/emoji/emoji_spec.js
+7
-7
spec/frontend/environment.js
spec/frontend/environment.js
+1
-1
spec/frontend/environments/environment_actions_spec.js
spec/frontend/environments/environment_actions_spec.js
+2
-2
spec/frontend/environments/environment_table_spec.js
spec/frontend/environments/environment_table_spec.js
+1
-1
spec/frontend/environments/environment_terminal_button_spec.js
...frontend/environments/environment_terminal_button_spec.js
+1
-1
spec/frontend/environments/folder/environments_folder_view_spec.js
...tend/environments/folder/environments_folder_view_spec.js
+1
-1
spec/frontend/error_tracking/components/error_details_spec.js
.../frontend/error_tracking/components/error_details_spec.js
+3
-3
spec/frontend/error_tracking/components/error_tracking_list_spec.js
...end/error_tracking/components/error_tracking_list_spec.js
+1
-1
spec/frontend/error_tracking/store/actions_spec.js
spec/frontend/error_tracking/store/actions_spec.js
+2
-2
spec/frontend/error_tracking/store/details/actions_spec.js
spec/frontend/error_tracking/store/details/actions_spec.js
+3
-3
spec/frontend/error_tracking/store/list/actions_spec.js
spec/frontend/error_tracking/store/list/actions_spec.js
+2
-2
spec/frontend/error_tracking_settings/store/actions_spec.js
spec/frontend/error_tracking_settings/store/actions_spec.js
+11
-11
spec/frontend/feature_flags/components/configure_feature_flags_modal_spec.js
...re_flags/components/configure_feature_flags_modal_spec.js
+1
-1
spec/frontend/feature_flags/components/edit_feature_flag_spec.js
...ontend/feature_flags/components/edit_feature_flag_spec.js
+1
-1
spec/frontend/feature_flags/components/environments_dropdown_spec.js
...nd/feature_flags/components/environments_dropdown_spec.js
+2
-2
spec/frontend/feature_flags/components/feature_flags_spec.js
spec/frontend/feature_flags/components/feature_flags_spec.js
+6
-6
spec/frontend/feature_flags/components/form_spec.js
spec/frontend/feature_flags/components/form_spec.js
+3
-3
spec/frontend/feature_flags/components/new_environments_dropdown_spec.js
...eature_flags/components/new_environments_dropdown_spec.js
+1
-1
spec/frontend/feature_flags/components/strategies/gitlab_user_list_spec.js
...ture_flags/components/strategies/gitlab_user_list_spec.js
+1
-1
spec/frontend/feature_flags/components/user_lists_table_spec.js
...rontend/feature_flags/components/user_lists_table_spec.js
+1
-1
spec/frontend/feature_flags/store/edit/actions_spec.js
spec/frontend/feature_flags/store/edit/actions_spec.js
+12
-12
spec/frontend/feature_flags/store/index/actions_spec.js
spec/frontend/feature_flags/store/index/actions_spec.js
+29
-29
spec/frontend/feature_flags/store/index/mutations_spec.js
spec/frontend/feature_flags/store/index/mutations_spec.js
+4
-4
spec/frontend/feature_flags/store/new/actions_spec.js
spec/frontend/feature_flags/store/new/actions_spec.js
+6
-6
spec/frontend/feature_highlight/feature_highlight_helper_spec.js
...ontend/feature_highlight/feature_highlight_helper_spec.js
+2
-2
spec/frontend/filtered_search/components/recent_searches_dropdown_content_spec.js
...earch/components/recent_searches_dropdown_content_spec.js
+1
-1
No files found.
.prettierignore
View file @
9180eaee
...
...
@@ -1706,39 +1706,6 @@ spec/frontend/behaviors/markdown/paste_markdown_table_spec.js
spec/frontend/behaviors/quick_submit_spec.js
spec/frontend/behaviors/secret_values_spec.js
## exciting-driscoll
spec/frontend/droplab/drop_down_spec.js
spec/frontend/droplab/plugins/ajax_filter_spec.js
spec/frontend/editor/editor_lite_extension_base_spec.js
spec/frontend/editor/editor_lite_spec.js
spec/frontend/editor/editor_markdown_ext_spec.js
spec/frontend/emoji/emoji_spec.js
spec/frontend/environment.js
spec/frontend/environments/environment_actions_spec.js
spec/frontend/environments/environment_table_spec.js
spec/frontend/environments/environment_terminal_button_spec.js
spec/frontend/environments/folder/environments_folder_view_spec.js
spec/frontend/error_tracking/components/error_details_spec.js
spec/frontend/error_tracking/components/error_tracking_list_spec.js
spec/frontend/error_tracking/store/actions_spec.js
spec/frontend/error_tracking/store/details/actions_spec.js
spec/frontend/error_tracking/store/list/actions_spec.js
spec/frontend/error_tracking_settings/store/actions_spec.js
spec/frontend/feature_flags/components/configure_feature_flags_modal_spec.js
spec/frontend/feature_flags/components/edit_feature_flag_spec.js
spec/frontend/feature_flags/components/environments_dropdown_spec.js
spec/frontend/feature_flags/components/feature_flags_spec.js
spec/frontend/feature_flags/components/form_spec.js
spec/frontend/feature_flags/components/new_environments_dropdown_spec.js
spec/frontend/feature_flags/components/strategies/gitlab_user_list_spec.js
spec/frontend/feature_flags/components/user_lists_table_spec.js
spec/frontend/feature_flags/store/edit/actions_spec.js
spec/frontend/feature_flags/store/index/actions_spec.js
spec/frontend/feature_flags/store/index/mutations_spec.js
spec/frontend/feature_flags/store/new/actions_spec.js
spec/frontend/feature_highlight/feature_highlight_helper_spec.js
spec/frontend/filtered_search/components/recent_searches_dropdown_content_spec.js
## determined-blackburn
spec/frontend/filtered_search/filtered_search_manager_spec.js
spec/frontend/filtered_search/filtered_search_token_keys_spec.js
...
...
spec/frontend/droplab/drop_down_spec.js
View file @
9180eaee
...
...
@@ -151,7 +151,7 @@ describe('DropLab DropDown', () => {
};
testContext
.
dummyListItem
=
document
.
createElement
(
'
li
'
);
jest
.
spyOn
(
testContext
.
event
.
target
,
'
closest
'
).
mockImplementation
(
selector
=>
{
jest
.
spyOn
(
testContext
.
event
.
target
,
'
closest
'
).
mockImplementation
(
(
selector
)
=>
{
if
(
selector
===
'
li
'
)
{
return
testContext
.
dummyListItem
;
}
...
...
@@ -402,7 +402,7 @@ describe('DropLab DropDown', () => {
beforeEach
(()
=>
{
testContext
.
renderableList
=
{};
testContext
.
list
=
{
querySelector
:
q
=>
{
querySelector
:
(
q
)
=>
{
if
(
q
===
'
.filter-dropdown-loading
'
)
{
return
false
;
}
...
...
@@ -414,7 +414,7 @@ describe('DropLab DropDown', () => {
testContext
.
data
=
[
0
,
1
];
testContext
.
customEvent
=
{};
jest
.
spyOn
(
testContext
.
dropdown
,
'
renderChildren
'
).
mockImplementation
(
data
=>
data
);
jest
.
spyOn
(
testContext
.
dropdown
,
'
renderChildren
'
).
mockImplementation
(
(
data
)
=>
data
);
jest
.
spyOn
(
testContext
.
list
,
'
dispatchEvent
'
).
mockImplementation
(()
=>
{});
jest
.
spyOn
(
testContext
.
data
,
'
map
'
);
jest
.
spyOn
(
window
,
'
CustomEvent
'
).
mockReturnValue
(
testContext
.
customEvent
);
...
...
@@ -465,7 +465,7 @@ describe('DropLab DropDown', () => {
testContext
.
dropdown
=
{
renderChildren
:
()
=>
{},
list
:
testContext
.
list
};
testContext
.
data
=
[
0
,
1
];
jest
.
spyOn
(
testContext
.
dropdown
,
'
renderChildren
'
).
mockImplementation
(
data
=>
data
);
jest
.
spyOn
(
testContext
.
dropdown
,
'
renderChildren
'
).
mockImplementation
(
(
data
)
=>
data
);
jest
.
spyOn
(
testContext
.
list
,
'
querySelector
'
).
mockImplementation
(()
=>
{});
jest
.
spyOn
(
testContext
.
data
,
'
map
'
);
...
...
spec/frontend/droplab/plugins/ajax_filter_spec.js
View file @
9180eaee
...
...
@@ -28,7 +28,7 @@ describe('AjaxFilter', () => {
let
ajaxSpy
;
beforeEach
(()
=>
{
jest
.
spyOn
(
AjaxCache
,
'
retrieve
'
).
mockImplementation
(
url
=>
ajaxSpy
(
url
));
jest
.
spyOn
(
AjaxCache
,
'
retrieve
'
).
mockImplementation
(
(
url
)
=>
ajaxSpy
(
url
));
jest
.
spyOn
(
AjaxFilter
,
'
_loadData
'
).
mockImplementation
(()
=>
{});
dummyConfig
.
onLoadingFinished
=
jest
.
fn
();
...
...
@@ -38,8 +38,8 @@ describe('AjaxFilter', () => {
dummyList
.
list
.
appendChild
(
dynamicList
);
});
it
(
'
calls onLoadingFinished after loading data
'
,
done
=>
{
ajaxSpy
=
url
=>
{
it
(
'
calls onLoadingFinished after loading data
'
,
(
done
)
=>
{
ajaxSpy
=
(
url
)
=>
{
expect
(
url
).
toBe
(
'
dummy endpoint?dummy search key=
'
);
return
Promise
.
resolve
(
dummyData
);
};
...
...
@@ -52,16 +52,16 @@ describe('AjaxFilter', () => {
.
catch
(
done
.
fail
);
});
it
(
'
does not call onLoadingFinished if Ajax call fails
'
,
done
=>
{
it
(
'
does not call onLoadingFinished if Ajax call fails
'
,
(
done
)
=>
{
const
dummyError
=
new
Error
(
'
My dummy is sick! :-(
'
);
ajaxSpy
=
url
=>
{
ajaxSpy
=
(
url
)
=>
{
expect
(
url
).
toBe
(
'
dummy endpoint?dummy search key=
'
);
return
Promise
.
reject
(
dummyError
);
};
AjaxFilter
.
trigger
()
.
then
(
done
.
fail
)
.
catch
(
error
=>
{
.
catch
(
(
error
)
=>
{
expect
(
error
).
toBe
(
dummyError
);
expect
(
dummyConfig
.
onLoadingFinished
.
mock
.
calls
.
length
).
toBe
(
0
);
})
...
...
spec/frontend/editor/editor_lite_extension_base_spec.js
View file @
9180eaee
...
...
@@ -16,7 +16,7 @@ describe('The basis for an Editor Lite extension', () => {
if
(
instance
)
{
if
(
options
)
{
Object
.
entries
(
options
).
forEach
(
prop
=>
{
Object
.
entries
(
options
).
forEach
(
(
prop
)
=>
{
expect
(
instance
[
prop
]).
toBeUndefined
();
});
// Both instance and options are passed
...
...
spec/frontend/editor/editor_lite_spec.js
View file @
9180eaee
...
...
@@ -324,13 +324,13 @@ describe('Base editor', () => {
${
'
multiple simple objects
'
}
|
${[
FooObjExt
,
BarObjExt
]}
|
${[
'
foo
'
,
'
bar
'
]}
|
${[
fooRes
,
barRes
]}
${
'
combination of ES6 classes and objects
'
}
|
${[
AlphaExt
,
BarObjExt
]}
|
${[
'
alpha
'
,
'
bar
'
]}
|
${[
alphaRes
,
barRes
]}
`
(
'
is extensible with $type
'
,
({
extensions
,
methods
,
expectations
}
=
{})
=>
{
methods
.
forEach
(
method
=>
{
methods
.
forEach
(
(
method
)
=>
{
expect
(
instance
[
method
]).
toBeUndefined
();
});
instance
.
use
(
extensions
);
methods
.
forEach
(
method
=>
{
methods
.
forEach
(
(
method
)
=>
{
expect
(
instance
[
method
]).
toBeDefined
();
});
...
...
@@ -359,7 +359,7 @@ describe('Base editor', () => {
it
.
each
([
WithStaticMethod
,
WithStaticMethodExtended
])(
'
properly resolves data for an extension with private data
'
,
ExtClass
=>
{
(
ExtClass
)
=>
{
const
base
=
1
;
expect
(
instance
.
base
).
toBeUndefined
();
expect
(
instance
.
boo
).
toBeUndefined
();
...
...
@@ -408,7 +408,7 @@ describe('Base editor', () => {
};
beforeEach
(()
=>
{
editorExtensionSpy
=
jest
.
spyOn
(
Editor
,
'
pushToImportsArray
'
).
mockImplementation
(
arr
=>
{
editorExtensionSpy
=
jest
.
spyOn
(
Editor
,
'
pushToImportsArray
'
).
mockImplementation
(
(
arr
)
=>
{
arr
.
push
(
Promise
.
resolve
({
default
:
{},
...
...
@@ -524,7 +524,7 @@ describe('Base editor', () => {
});
it
(
'
sets default syntax highlighting theme
'
,
()
=>
{
const
expectedTheme
=
themes
.
find
(
t
=>
t
.
name
===
DEFAULT_THEME
);
const
expectedTheme
=
themes
.
find
(
(
t
)
=>
t
.
name
===
DEFAULT_THEME
);
editor
=
new
Editor
();
...
...
@@ -533,7 +533,7 @@ describe('Base editor', () => {
});
it
(
'
sets correct theme if it is set in users preferences
'
,
()
=>
{
const
expectedTheme
=
themes
.
find
(
t
=>
t
.
name
!==
DEFAULT_THEME
);
const
expectedTheme
=
themes
.
find
(
(
t
)
=>
t
.
name
!==
DEFAULT_THEME
);
expect
(
expectedTheme
.
name
).
not
.
toBe
(
DEFAULT_THEME
);
...
...
spec/frontend/editor/editor_markdown_ext_spec.js
View file @
9180eaee
...
...
@@ -114,7 +114,7 @@ describe('Markdown Extension for Editor Lite', () => {
});
describe
(
'
moveCursor
'
,
()
=>
{
const
setPosition
=
endCol
=>
{
const
setPosition
=
(
endCol
)
=>
{
const
currentPos
=
new
Position
(
2
,
endCol
);
instance
.
setPosition
(
currentPos
);
};
...
...
spec/frontend/emoji/emoji_spec.js
View file @
9180eaee
...
...
@@ -369,11 +369,11 @@ describe('gl_emoji', () => {
describe
(
'
searchEmoji
'
,
()
=>
{
const
{
atom
,
grey_question
}
=
emojiFixtureMap
;
const
search
=
(
query
,
opts
)
=>
searchEmoji
(
query
,
opts
).
map
(({
name
})
=>
name
);
const
mangle
=
str
=>
str
.
slice
(
0
,
1
)
+
str
.
slice
(
-
1
);
const
partial
=
str
=>
str
.
slice
(
0
,
2
);
const
mangle
=
(
str
)
=>
str
.
slice
(
0
,
1
)
+
str
.
slice
(
-
1
);
const
partial
=
(
str
)
=>
str
.
slice
(
0
,
2
);
describe
(
'
with default options
'
,
()
=>
{
const
subject
=
query
=>
search
(
query
);
const
subject
=
(
query
)
=>
search
(
query
);
describeEmojiFields
(
'
with $field
'
,
({
accessor
})
=>
{
it
(
`should match by lower case:
${
accessor
(
atom
)}
`
,
()
=>
{
...
...
@@ -403,7 +403,7 @@ describe('gl_emoji', () => {
});
describe
(
'
with fuzzy match
'
,
()
=>
{
const
subject
=
query
=>
search
(
query
,
{
match
:
'
fuzzy
'
});
const
subject
=
(
query
)
=>
search
(
query
,
{
match
:
'
fuzzy
'
});
describeEmojiFields
(
'
with $field
'
,
({
accessor
})
=>
{
it
(
`should match by lower case:
${
accessor
(
atom
)}
`
,
()
=>
{
...
...
@@ -421,7 +421,7 @@ describe('gl_emoji', () => {
});
describe
(
'
with contains match
'
,
()
=>
{
const
subject
=
query
=>
search
(
query
,
{
match
:
'
contains
'
});
const
subject
=
(
query
)
=>
search
(
query
,
{
match
:
'
contains
'
});
describeEmojiFields
(
'
with $field
'
,
({
accessor
})
=>
{
it
(
`should match by lower case:
${
accessor
(
atom
)}
`
,
()
=>
{
...
...
@@ -443,7 +443,7 @@ describe('gl_emoji', () => {
});
describe
(
'
with fallback
'
,
()
=>
{
const
subject
=
query
=>
search
(
query
,
{
fallback
:
true
});
const
subject
=
(
query
)
=>
search
(
query
,
{
fallback
:
true
});
it
.
each
`
query
...
...
@@ -454,7 +454,7 @@ describe('gl_emoji', () => {
});
describe
(
'
with name and alias fields
'
,
()
=>
{
const
subject
=
query
=>
search
(
query
,
{
fields
:
[
'
name
'
,
'
alias
'
]
});
const
subject
=
(
query
)
=>
search
(
query
,
{
fields
:
[
'
name
'
,
'
alias
'
]
});
it
(
`should match by name:
${
atom
.
name
}
`
,
()
=>
{
expect
(
subject
(
atom
.
name
)).
toContain
(
atom
.
name
);
...
...
spec/frontend/environment.js
View file @
9180eaee
...
...
@@ -37,7 +37,7 @@ class CustomEnvironment extends JSDOMEnvironment {
this
.
rejectedPromises
=
[];
this
.
global
.
promiseRejectionHandler
=
error
=>
{
this
.
global
.
promiseRejectionHandler
=
(
error
)
=>
{
this
.
rejectedPromises
.
push
(
error
);
};
...
...
spec/frontend/environments/environment_actions_spec.js
View file @
9180eaee
...
...
@@ -38,9 +38,9 @@ describe('EnvironmentActions Component', () => {
return
createComponent
({
actions
:
[
scheduledJobAction
,
expiredJobAction
]
},
opts
);
}
const
findDropdownItem
=
action
=>
{
const
findDropdownItem
=
(
action
)
=>
{
const
buttons
=
wrapper
.
findAll
(
GlDropdownItem
);
return
buttons
.
filter
(
button
=>
button
.
text
().
startsWith
(
action
.
name
)).
at
(
0
);
return
buttons
.
filter
(
(
button
)
=>
button
.
text
().
startsWith
(
action
.
name
)).
at
(
0
);
};
afterEach
(()
=>
{
...
...
spec/frontend/environments/environment_table_spec.js
View file @
9180eaee
...
...
@@ -266,7 +266,7 @@ describe('Environment table', () => {
},
});
expect
(
wrapper
.
vm
.
sortedEnvironments
.
map
(
env
=>
env
.
name
)).
toEqual
([
expect
(
wrapper
.
vm
.
sortedEnvironments
.
map
(
(
env
)
=>
env
.
name
)).
toEqual
([
review
.
name
,
staging
.
name
,
production
.
name
,
...
...
spec/frontend/environments/environment_terminal_button_spec.js
View file @
9180eaee
...
...
@@ -5,7 +5,7 @@ describe('Stop Component', () => {
let
wrapper
;
const
terminalPath
=
'
/path
'
;
const
mountWithProps
=
props
=>
{
const
mountWithProps
=
(
props
)
=>
{
wrapper
=
shallowMount
(
TerminalComponent
,
{
propsData
:
props
,
});
...
...
spec/frontend/environments/folder/environments_folder_view_spec.js
View file @
9180eaee
...
...
@@ -23,7 +23,7 @@ describe('Environments Folder View', () => {
helpCanaryDeploymentsPath
:
'
help/canary-deployments
'
,
};
const
mockEnvironments
=
environmentList
=>
{
const
mockEnvironments
=
(
environmentList
)
=>
{
mock
.
onGet
(
mockData
.
endpoint
).
reply
(
200
,
{
...
...
spec/frontend/error_tracking/components/error_details_spec.js
View file @
9180eaee
...
...
@@ -38,8 +38,8 @@ describe('ErrorDetails', () => {
let
mocks
;
const
externalUrl
=
'
https://sentry.io/organizations/test-sentry-nk/issues/1/?project=1
'
;
const
findInput
=
name
=>
{
const
inputs
=
wrapper
.
findAll
(
GlFormInput
).
filter
(
c
=>
c
.
attributes
(
'
name
'
)
===
name
);
const
findInput
=
(
name
)
=>
{
const
inputs
=
wrapper
.
findAll
(
GlFormInput
).
filter
(
(
c
)
=>
c
.
attributes
(
'
name
'
)
===
name
);
return
inputs
.
length
?
inputs
.
at
(
0
)
:
inputs
;
};
...
...
@@ -245,7 +245,7 @@ describe('ErrorDetails', () => {
it
.
each
(
Object
.
keys
(
severityLevel
))(
'
should set correct severity level variant for %s badge
'
,
level
=>
{
(
level
)
=>
{
wrapper
.
setData
({
error
:
{
tags
:
{
level
:
severityLevel
[
level
]
},
...
...
spec/frontend/error_tracking/components/error_tracking_list_spec.js
View file @
9180eaee
...
...
@@ -147,7 +147,7 @@ describe('ErrorTrackingList', () => {
});
it
(
'
each error in the list should have an action button set
'
,
()
=>
{
findErrorListRows
().
wrappers
.
forEach
(
row
=>
{
findErrorListRows
().
wrappers
.
forEach
(
(
row
)
=>
{
expect
(
row
.
find
(
ErrorTrackingActions
).
exists
()).
toBe
(
true
);
});
});
...
...
spec/frontend/error_tracking/store/actions_spec.js
View file @
9180eaee
...
...
@@ -28,7 +28,7 @@ describe('Sentry common store actions', () => {
const
params
=
{
endpoint
,
redirectUrl
,
status
};
describe
(
'
updateStatus
'
,
()
=>
{
it
(
'
should handle successful status update
'
,
done
=>
{
it
(
'
should handle successful status update
'
,
(
done
)
=>
{
mock
.
onPut
().
reply
(
200
,
{});
testAction
(
actions
.
updateStatus
,
...
...
@@ -48,7 +48,7 @@ describe('Sentry common store actions', () => {
);
});
it
(
'
should handle unsuccessful status update
'
,
done
=>
{
it
(
'
should handle unsuccessful status update
'
,
(
done
)
=>
{
mock
.
onPut
().
reply
(
400
,
{});
testAction
(
actions
.
updateStatus
,
params
,
{},
[],
[],
()
=>
{
expect
(
visitUrl
).
not
.
toHaveBeenCalled
();
...
...
spec/frontend/error_tracking/store/details/actions_spec.js
View file @
9180eaee
...
...
@@ -28,7 +28,7 @@ describe('Sentry error details store actions', () => {
describe
(
'
startPollingStacktrace
'
,
()
=>
{
const
endpoint
=
'
123/stacktrace
'
;
it
(
'
should commit SET_ERROR with received response
'
,
done
=>
{
it
(
'
should commit SET_ERROR with received response
'
,
(
done
)
=>
{
const
payload
=
{
error
:
[
1
,
2
,
3
]
};
mockedAdapter
.
onGet
().
reply
(
200
,
payload
);
testAction
(
...
...
@@ -46,7 +46,7 @@ describe('Sentry error details store actions', () => {
);
});
it
(
'
should show flash on API error
'
,
done
=>
{
it
(
'
should show flash on API error
'
,
(
done
)
=>
{
mockedAdapter
.
onGet
().
reply
(
400
);
testAction
(
...
...
@@ -62,7 +62,7 @@ describe('Sentry error details store actions', () => {
);
});
it
(
'
should not restart polling when receiving an empty 204 response
'
,
done
=>
{
it
(
'
should not restart polling when receiving an empty 204 response
'
,
(
done
)
=>
{
mockedRestart
=
jest
.
spyOn
(
Poll
.
prototype
,
'
restart
'
);
mockedAdapter
.
onGet
().
reply
(
204
);
...
...
spec/frontend/error_tracking/store/list/actions_spec.js
View file @
9180eaee
...
...
@@ -20,7 +20,7 @@ describe('error tracking actions', () => {
});
describe
(
'
startPolling
'
,
()
=>
{
it
(
'
should start polling for data
'
,
done
=>
{
it
(
'
should start polling for data
'
,
(
done
)
=>
{
const
payload
=
{
errors
:
[{
id
:
1
},
{
id
:
2
}]
};
mock
.
onGet
().
reply
(
httpStatusCodes
.
OK
,
payload
);
...
...
@@ -41,7 +41,7 @@ describe('error tracking actions', () => {
);
});
it
(
'
should show flash on API error
'
,
done
=>
{
it
(
'
should show flash on API error
'
,
(
done
)
=>
{
mock
.
onGet
().
reply
(
httpStatusCodes
.
BAD_REQUEST
);
testAction
(
...
...
spec/frontend/error_tracking_settings/store/actions_spec.js
View file @
9180eaee
...
...
@@ -27,7 +27,7 @@ describe('error tracking settings actions', () => {
refreshCurrentPage
.
mockClear
();
});
it
(
'
should request and transform the project list
'
,
done
=>
{
it
(
'
should request and transform the project list
'
,
(
done
)
=>
{
mock
.
onGet
(
TEST_HOST
).
reply
(()
=>
[
200
,
{
projects
:
projectList
}]);
testAction
(
actions
.
fetchProjects
,
...
...
@@ -48,7 +48,7 @@ describe('error tracking settings actions', () => {
);
});
it
(
'
should handle a server error
'
,
done
=>
{
it
(
'
should handle a server error
'
,
(
done
)
=>
{
mock
.
onGet
(
`
${
TEST_HOST
}
.json`
).
reply
(()
=>
[
400
]);
testAction
(
actions
.
fetchProjects
,
...
...
@@ -68,7 +68,7 @@ describe('error tracking settings actions', () => {
);
});
it
(
'
should request projects correctly
'
,
done
=>
{
it
(
'
should request projects correctly
'
,
(
done
)
=>
{
testAction
(
actions
.
requestProjects
,
null
,
...
...
@@ -79,7 +79,7 @@ describe('error tracking settings actions', () => {
);
});
it
(
'
should receive projects correctly
'
,
done
=>
{
it
(
'
should receive projects correctly
'
,
(
done
)
=>
{
const
testPayload
=
[];
testAction
(
actions
.
receiveProjectsSuccess
,
...
...
@@ -95,7 +95,7 @@ describe('error tracking settings actions', () => {
);
});
it
(
'
should handle errors when receiving projects
'
,
done
=>
{
it
(
'
should handle errors when receiving projects
'
,
(
done
)
=>
{
const
testPayload
=
[];
testAction
(
actions
.
receiveProjectsError
,
...
...
@@ -126,7 +126,7 @@ describe('error tracking settings actions', () => {
mock
.
restore
();
});
it
(
'
should save the page
'
,
done
=>
{
it
(
'
should save the page
'
,
(
done
)
=>
{
mock
.
onPatch
(
TEST_HOST
).
reply
(
200
);
testAction
(
actions
.
updateSettings
,
null
,
state
,
[],
[{
type
:
'
requestSettings
'
}],
()
=>
{
expect
(
mock
.
history
.
patch
.
length
).
toBe
(
1
);
...
...
@@ -135,7 +135,7 @@ describe('error tracking settings actions', () => {
});
});
it
(
'
should handle a server error
'
,
done
=>
{
it
(
'
should handle a server error
'
,
(
done
)
=>
{
mock
.
onPatch
(
TEST_HOST
).
reply
(
400
);
testAction
(
actions
.
updateSettings
,
...
...
@@ -156,7 +156,7 @@ describe('error tracking settings actions', () => {
);
});
it
(
'
should request to save the page
'
,
done
=>
{
it
(
'
should request to save the page
'
,
(
done
)
=>
{
testAction
(
actions
.
requestSettings
,
null
,
...
...
@@ -167,7 +167,7 @@ describe('error tracking settings actions', () => {
);
});
it
(
'
should handle errors when requesting to save the page
'
,
done
=>
{
it
(
'
should handle errors when requesting to save the page
'
,
(
done
)
=>
{
testAction
(
actions
.
receiveSettingsError
,
{},
...
...
@@ -181,7 +181,7 @@ describe('error tracking settings actions', () => {
describe
(
'
generic actions to update the store
'
,
()
=>
{
const
testData
=
'
test
'
;
it
(
'
should reset the `connect success` flag when updating the api host
'
,
done
=>
{
it
(
'
should reset the `connect success` flag when updating the api host
'
,
(
done
)
=>
{
testAction
(
actions
.
updateApiHost
,
testData
,
...
...
@@ -192,7 +192,7 @@ describe('error tracking settings actions', () => {
);
});
it
(
'
should reset the `connect success` flag when updating the token
'
,
done
=>
{
it
(
'
should reset the `connect success` flag when updating the token
'
,
(
done
)
=>
{
testAction
(
actions
.
updateToken
,
testData
,
...
...
spec/frontend/feature_flags/components/configure_feature_flags_modal_spec.js
View file @
9180eaee
...
...
@@ -36,7 +36,7 @@ describe('Configure Feature Flags Modal', () => {
const
findPrimaryAction
=
()
=>
findGlModal
().
props
(
'
actionPrimary
'
);
const
findProjectNameInput
=
()
=>
wrapper
.
find
(
'
#project_name_verification
'
);
const
findDangerGlAlert
=
()
=>
wrapper
.
findAll
(
GlAlert
).
filter
(
c
=>
c
.
props
(
'
variant
'
)
===
'
danger
'
);
wrapper
.
findAll
(
GlAlert
).
filter
(
(
c
)
=>
c
.
props
(
'
variant
'
)
===
'
danger
'
);
describe
(
'
idle
'
,
()
=>
{
afterEach
(()
=>
wrapper
.
destroy
());
...
...
spec/frontend/feature_flags/components/edit_feature_flag_spec.js
View file @
9180eaee
...
...
@@ -42,7 +42,7 @@ describe('Edit feature flag form', () => {
});
};
beforeEach
(
done
=>
{
beforeEach
(
(
done
)
=>
{
mock
=
new
MockAdapter
(
axios
);
mock
.
onGet
(
`
${
TEST_HOST
}
/feature_flags.json`
).
replyOnce
(
200
,
{
id
:
21
,
...
...
spec/frontend/feature_flags/components/environments_dropdown_spec.js
View file @
9180eaee
...
...
@@ -11,7 +11,7 @@ describe('Feature flags > Environments dropdown ', () => {
let
wrapper
;
let
mock
;
const
results
=
[
'
production
'
,
'
staging
'
];
const
factory
=
props
=>
{
const
factory
=
(
props
)
=>
{
wrapper
=
shallowMount
(
EnvironmentsDropdown
,
{
propsData
:
{
...
props
,
...
...
@@ -100,7 +100,7 @@ describe('Feature flags > Environments dropdown ', () => {
it
(
'
emits event when a suggestion is clicked
'
,
async
()
=>
{
const
button
=
wrapper
.
findAll
(
GlButton
)
.
filter
(
b
=>
b
.
text
()
===
'
production
'
)
.
filter
(
(
b
)
=>
b
.
text
()
===
'
production
'
)
.
at
(
0
);
button
.
vm
.
$emit
(
'
click
'
);
await
wrapper
.
vm
.
$nextTick
();
...
...
spec/frontend/feature_flags/components/feature_flags_spec.js
View file @
9180eaee
...
...
@@ -85,7 +85,7 @@ describe('Feature flags', () => {
describe
(
'
when limit exceeded
'
,
()
=>
{
const
provideData
=
{
...
mockData
,
featureFlagsLimitExceeded
:
true
};
beforeEach
(
done
=>
{
beforeEach
(
(
done
)
=>
{
mock
.
onGet
(
`
${
TEST_HOST
}
/endpoint.json`
,
{
params
:
{
scope
:
FEATURE_FLAG_SCOPE
,
page
:
'
1
'
}
})
.
reply
(
200
,
getRequestData
,
{});
...
...
@@ -132,7 +132,7 @@ describe('Feature flags', () => {
newUserListPath
:
null
,
};
beforeEach
(
done
=>
{
beforeEach
(
(
done
)
=>
{
mock
.
onGet
(
`
${
TEST_HOST
}
/endpoint.json`
,
{
params
:
{
scope
:
FEATURE_FLAG_SCOPE
,
page
:
'
1
'
}
})
.
reply
(
200
,
getRequestData
,
{});
...
...
@@ -217,7 +217,7 @@ describe('Feature flags', () => {
});
describe
(
'
with paginated feature flags
'
,
()
=>
{
beforeEach
(
done
=>
{
beforeEach
(
(
done
)
=>
{
mock
.
onGet
(
mockState
.
endpoint
,
{
params
:
{
scope
:
FEATURE_FLAG_SCOPE
,
page
:
'
1
'
}
})
.
replyOnce
(
200
,
getRequestData
,
{
...
...
@@ -297,7 +297,7 @@ describe('Feature flags', () => {
});
describe
(
'
in user lists tab
'
,
()
=>
{
beforeEach
(
done
=>
{
beforeEach
(
(
done
)
=>
{
factory
();
setImmediate
(
done
);
});
...
...
@@ -317,7 +317,7 @@ describe('Feature flags', () => {
});
describe
(
'
unsuccessful request
'
,
()
=>
{
beforeEach
(
done
=>
{
beforeEach
(
(
done
)
=>
{
mock
.
onGet
(
mockState
.
endpoint
,
{
params
:
{
scope
:
FEATURE_FLAG_SCOPE
,
page
:
'
1
'
}
})
.
replyOnce
(
500
,
{});
...
...
@@ -350,7 +350,7 @@ describe('Feature flags', () => {
});
describe
(
'
rotate instance id
'
,
()
=>
{
beforeEach
(
done
=>
{
beforeEach
(
(
done
)
=>
{
mock
.
onGet
(
`
${
TEST_HOST
}
/endpoint.json`
,
{
params
:
{
scope
:
FEATURE_FLAG_SCOPE
,
page
:
'
1
'
}
})
.
reply
(
200
,
getRequestData
,
{});
...
...
spec/frontend/feature_flags/components/form_spec.js
View file @
9180eaee
...
...
@@ -118,7 +118,7 @@ describe('feature flag form', () => {
});
});
it
(
'
should be disabled if the feature flag is not active
'
,
done
=>
{
it
(
'
should be disabled if the feature flag is not active
'
,
(
done
)
=>
{
wrapper
.
setProps
({
active
:
false
});
wrapper
.
vm
.
$nextTick
(()
=>
{
expect
(
wrapper
.
find
(
ToggleButton
).
props
(
'
disabledInput
'
)).
toBe
(
true
);
...
...
@@ -191,7 +191,7 @@ describe('feature flag form', () => {
expect
(
wrapper
.
vm
.
formScopes
[
0
].
active
).
toBe
(
false
);
});
it
(
'
should be disabled if the feature flag is not active
'
,
done
=>
{
it
(
'
should be disabled if the feature flag is not active
'
,
(
done
)
=>
{
wrapper
.
setProps
({
active
:
false
});
wrapper
.
vm
.
$nextTick
(()
=>
{
...
...
@@ -301,7 +301,7 @@ describe('feature flag form', () => {
});
describe
(
'
on submit
'
,
()
=>
{
const
selectFirstRolloutStrategyOption
=
dropdownIndex
=>
{
const
selectFirstRolloutStrategyOption
=
(
dropdownIndex
)
=>
{
wrapper
.
findAll
(
'
select.js-rollout-strategy
'
)
.
at
(
dropdownIndex
)
...
...
spec/frontend/feature_flags/components/new_environments_dropdown_spec.js
View file @
9180eaee
...
...
@@ -94,7 +94,7 @@ describe('New Environments Dropdown', () => {
});
it
(
'
should not display a create label
'
,
()
=>
{
items
=
items
.
filter
(
i
=>
i
.
text
().
startsWith
(
'
Create
'
));
items
=
items
.
filter
(
(
i
)
=>
i
.
text
().
startsWith
(
'
Create
'
));
expect
(
items
).
toHaveLength
(
0
);
});
...
...
spec/frontend/feature_flags/components/strategies/gitlab_user_list_spec.js
View file @
9180eaee
...
...
@@ -66,7 +66,7 @@ describe('~/feature_flags/components/strategies/gitlab_user_list.vue', () => {
it
(
'
should search when the filter changes
'
,
async
()
=>
{
let
r
;
Api
.
searchFeatureFlagUserLists
.
mockReturnValue
(
new
Promise
(
resolve
=>
{
new
Promise
(
(
resolve
)
=>
{
r
=
resolve
;
}),
);
...
...
spec/frontend/feature_flags/components/user_lists_table_spec.js
View file @
9180eaee
...
...
@@ -42,7 +42,7 @@ describe('User Lists Table', () => {
it
(
'
should display a user list entry per user list
'
,
()
=>
{
const
lists
=
wrapper
.
findAll
(
'
[data-testid="ffUserList"]
'
);
expect
(
lists
).
toHaveLength
(
5
);
lists
.
wrappers
.
forEach
(
list
=>
{
lists
.
wrappers
.
forEach
(
(
list
)
=>
{
expect
(
list
.
find
(
'
[data-testid="ffUserListName"]
'
).
exists
()).
toBe
(
true
);
expect
(
list
.
find
(
'
[data-testid="ffUserListIds"]
'
).
exists
()).
toBe
(
true
);
expect
(
list
.
find
(
'
[data-testid="ffUserListTimestamp"]
'
).
exists
()).
toBe
(
true
);
...
...
spec/frontend/feature_flags/store/edit/actions_spec.js
View file @
9180eaee
...
...
@@ -44,7 +44,7 @@ describe('Feature flags Edit Module actions', () => {
});
describe
(
'
success
'
,
()
=>
{
it
(
'
dispatches requestUpdateFeatureFlag and receiveUpdateFeatureFlagSuccess
'
,
done
=>
{
it
(
'
dispatches requestUpdateFeatureFlag and receiveUpdateFeatureFlagSuccess
'
,
(
done
)
=>
{
const
featureFlag
=
{
name
:
'
feature_flag
'
,
description
:
'
feature flag
'
,
...
...
@@ -80,7 +80,7 @@ describe('Feature flags Edit Module actions', () => {
done
,
);
});
it
(
'
handles new version flags as well
'
,
done
=>
{
it
(
'
handles new version flags as well
'
,
(
done
)
=>
{
const
featureFlag
=
{
name
:
'
name
'
,
description
:
'
description
'
,
...
...
@@ -117,7 +117,7 @@ describe('Feature flags Edit Module actions', () => {
});
describe
(
'
error
'
,
()
=>
{
it
(
'
dispatches requestUpdateFeatureFlag and receiveUpdateFeatureFlagError
'
,
done
=>
{
it
(
'
dispatches requestUpdateFeatureFlag and receiveUpdateFeatureFlagError
'
,
(
done
)
=>
{
mock
.
onPut
(
`
${
TEST_HOST
}
/endpoint.json`
).
replyOnce
(
500
,
{
message
:
[]
});
testAction
(
...
...
@@ -145,7 +145,7 @@ describe('Feature flags Edit Module actions', () => {
});
describe
(
'
requestUpdateFeatureFlag
'
,
()
=>
{
it
(
'
should commit REQUEST_UPDATE_FEATURE_FLAG mutation
'
,
done
=>
{
it
(
'
should commit REQUEST_UPDATE_FEATURE_FLAG mutation
'
,
(
done
)
=>
{
testAction
(
requestUpdateFeatureFlag
,
null
,
...
...
@@ -158,7 +158,7 @@ describe('Feature flags Edit Module actions', () => {
});
describe
(
'
receiveUpdateFeatureFlagSuccess
'
,
()
=>
{
it
(
'
should commit RECEIVE_UPDATE_FEATURE_FLAG_SUCCESS mutation
'
,
done
=>
{
it
(
'
should commit RECEIVE_UPDATE_FEATURE_FLAG_SUCCESS mutation
'
,
(
done
)
=>
{
testAction
(
receiveUpdateFeatureFlagSuccess
,
null
,
...
...
@@ -175,7 +175,7 @@ describe('Feature flags Edit Module actions', () => {
});
describe
(
'
receiveUpdateFeatureFlagError
'
,
()
=>
{
it
(
'
should commit RECEIVE_UPDATE_FEATURE_FLAG_ERROR mutation
'
,
done
=>
{
it
(
'
should commit RECEIVE_UPDATE_FEATURE_FLAG_ERROR mutation
'
,
(
done
)
=>
{
testAction
(
receiveUpdateFeatureFlagError
,
'
There was an error
'
,
...
...
@@ -200,7 +200,7 @@ describe('Feature flags Edit Module actions', () => {
});
describe
(
'
success
'
,
()
=>
{
it
(
'
dispatches requestFeatureFlag and receiveFeatureFlagSuccess
'
,
done
=>
{
it
(
'
dispatches requestFeatureFlag and receiveFeatureFlagSuccess
'
,
(
done
)
=>
{
mock
.
onGet
(
`
${
TEST_HOST
}
/endpoint.json`
).
replyOnce
(
200
,
{
id
:
1
});
testAction
(
...
...
@@ -223,7 +223,7 @@ describe('Feature flags Edit Module actions', () => {
});
describe
(
'
error
'
,
()
=>
{
it
(
'
dispatches requestFeatureFlag and receiveUpdateFeatureFlagError
'
,
done
=>
{
it
(
'
dispatches requestFeatureFlag and receiveUpdateFeatureFlagError
'
,
(
done
)
=>
{
mock
.
onGet
(
`
${
TEST_HOST
}
/endpoint.json`
,
{}).
replyOnce
(
500
,
{});
testAction
(
...
...
@@ -246,7 +246,7 @@ describe('Feature flags Edit Module actions', () => {
});
describe
(
'
requestFeatureFlag
'
,
()
=>
{
it
(
'
should commit REQUEST_FEATURE_FLAG mutation
'
,
done
=>
{
it
(
'
should commit REQUEST_FEATURE_FLAG mutation
'
,
(
done
)
=>
{
testAction
(
requestFeatureFlag
,
null
,
...
...
@@ -259,7 +259,7 @@ describe('Feature flags Edit Module actions', () => {
});
describe
(
'
receiveFeatureFlagSuccess
'
,
()
=>
{
it
(
'
should commit RECEIVE_FEATURE_FLAG_SUCCESS mutation
'
,
done
=>
{
it
(
'
should commit RECEIVE_FEATURE_FLAG_SUCCESS mutation
'
,
(
done
)
=>
{
testAction
(
receiveFeatureFlagSuccess
,
{
id
:
1
},
...
...
@@ -272,7 +272,7 @@ describe('Feature flags Edit Module actions', () => {
});
describe
(
'
receiveFeatureFlagError
'
,
()
=>
{
it
(
'
should commit RECEIVE_FEATURE_FLAG_ERROR mutation
'
,
done
=>
{
it
(
'
should commit RECEIVE_FEATURE_FLAG_ERROR mutation
'
,
(
done
)
=>
{
testAction
(
receiveFeatureFlagError
,
null
,
...
...
@@ -289,7 +289,7 @@ describe('Feature flags Edit Module actions', () => {
});
describe
(
'
toggelActive
'
,
()
=>
{
it
(
'
should commit TOGGLE_ACTIVE mutation
'
,
done
=>
{
it
(
'
should commit TOGGLE_ACTIVE mutation
'
,
(
done
)
=>
{
testAction
(
toggleActive
,
true
,
...
...
spec/frontend/feature_flags/store/index/actions_spec.js
View file @
9180eaee
...
...
@@ -40,7 +40,7 @@ describe('Feature flags actions', () => {
});
describe
(
'
setFeatureFlagsOptions
'
,
()
=>
{
it
(
'
should commit SET_FEATURE_FLAGS_OPTIONS mutation
'
,
done
=>
{
it
(
'
should commit SET_FEATURE_FLAGS_OPTIONS mutation
'
,
(
done
)
=>
{
testAction
(
setFeatureFlagsOptions
,
{
page
:
'
1
'
,
scope
:
'
all
'
},
...
...
@@ -65,7 +65,7 @@ describe('Feature flags actions', () => {
});
describe
(
'
success
'
,
()
=>
{
it
(
'
dispatches requestFeatureFlags and receiveFeatureFlagsSuccess
'
,
done
=>
{
it
(
'
dispatches requestFeatureFlags and receiveFeatureFlagsSuccess
'
,
(
done
)
=>
{
mock
.
onGet
(
`
${
TEST_HOST
}
/endpoint.json`
).
replyOnce
(
200
,
getRequestData
,
{});
testAction
(
...
...
@@ -88,7 +88,7 @@ describe('Feature flags actions', () => {
});
describe
(
'
error
'
,
()
=>
{
it
(
'
dispatches requestFeatureFlags and receiveFeatureFlagsError
'
,
done
=>
{
it
(
'
dispatches requestFeatureFlags and receiveFeatureFlagsError
'
,
(
done
)
=>
{
mock
.
onGet
(
`
${
TEST_HOST
}
/endpoint.json`
,
{}).
replyOnce
(
500
,
{});
testAction
(
...
...
@@ -111,7 +111,7 @@ describe('Feature flags actions', () => {
});
describe
(
'
requestFeatureFlags
'
,
()
=>
{
it
(
'
should commit RECEIVE_FEATURE_FLAGS_SUCCESS mutation
'
,
done
=>
{
it
(
'
should commit RECEIVE_FEATURE_FLAGS_SUCCESS mutation
'
,
(
done
)
=>
{
testAction
(
requestFeatureFlags
,
null
,
...
...
@@ -124,7 +124,7 @@ describe('Feature flags actions', () => {
});
describe
(
'
receiveFeatureFlagsSuccess
'
,
()
=>
{
it
(
'
should commit RECEIVE_FEATURE_FLAGS_SUCCESS mutation
'
,
done
=>
{
it
(
'
should commit RECEIVE_FEATURE_FLAGS_SUCCESS mutation
'
,
(
done
)
=>
{
testAction
(
receiveFeatureFlagsSuccess
,
{
data
:
getRequestData
,
headers
:
{}
},
...
...
@@ -142,7 +142,7 @@ describe('Feature flags actions', () => {
});
describe
(
'
receiveFeatureFlagsError
'
,
()
=>
{
it
(
'
should commit RECEIVE_FEATURE_FLAGS_ERROR mutation
'
,
done
=>
{
it
(
'
should commit RECEIVE_FEATURE_FLAGS_ERROR mutation
'
,
(
done
)
=>
{
testAction
(
receiveFeatureFlagsError
,
null
,
...
...
@@ -160,7 +160,7 @@ describe('Feature flags actions', () => {
});
describe
(
'
success
'
,
()
=>
{
it
(
'
dispatches requestUserLists and receiveUserListsSuccess
'
,
done
=>
{
it
(
'
dispatches requestUserLists and receiveUserListsSuccess
'
,
(
done
)
=>
{
testAction
(
fetchUserLists
,
null
,
...
...
@@ -181,7 +181,7 @@ describe('Feature flags actions', () => {
});
describe
(
'
error
'
,
()
=>
{
it
(
'
dispatches requestUserLists and receiveUserListsError
'
,
done
=>
{
it
(
'
dispatches requestUserLists and receiveUserListsError
'
,
(
done
)
=>
{
Api
.
fetchFeatureFlagUserLists
.
mockRejectedValue
();
testAction
(
...
...
@@ -204,7 +204,7 @@ describe('Feature flags actions', () => {
});
describe
(
'
requestUserLists
'
,
()
=>
{
it
(
'
should commit RECEIVE_USER_LISTS_SUCCESS mutation
'
,
done
=>
{
it
(
'
should commit RECEIVE_USER_LISTS_SUCCESS mutation
'
,
(
done
)
=>
{
testAction
(
requestUserLists
,
null
,
...
...
@@ -217,7 +217,7 @@ describe('Feature flags actions', () => {
});
describe
(
'
receiveUserListsSuccess
'
,
()
=>
{
it
(
'
should commit RECEIVE_USER_LISTS_SUCCESS mutation
'
,
done
=>
{
it
(
'
should commit RECEIVE_USER_LISTS_SUCCESS mutation
'
,
(
done
)
=>
{
testAction
(
receiveUserListsSuccess
,
{
data
:
[
userList
],
headers
:
{}
},
...
...
@@ -235,7 +235,7 @@ describe('Feature flags actions', () => {
});
describe
(
'
receiveUserListsError
'
,
()
=>
{
it
(
'
should commit RECEIVE_USER_LISTS_ERROR mutation
'
,
done
=>
{
it
(
'
should commit RECEIVE_USER_LISTS_ERROR mutation
'
,
(
done
)
=>
{
testAction
(
receiveUserListsError
,
null
,
...
...
@@ -260,7 +260,7 @@ describe('Feature flags actions', () => {
});
describe
(
'
success
'
,
()
=>
{
it
(
'
dispatches requestRotateInstanceId and receiveRotateInstanceIdSuccess
'
,
done
=>
{
it
(
'
dispatches requestRotateInstanceId and receiveRotateInstanceIdSuccess
'
,
(
done
)
=>
{
mock
.
onPost
(
`
${
TEST_HOST
}
/endpoint.json`
).
replyOnce
(
200
,
rotateData
,
{});
testAction
(
...
...
@@ -283,7 +283,7 @@ describe('Feature flags actions', () => {
});
describe
(
'
error
'
,
()
=>
{
it
(
'
dispatches requestRotateInstanceId and receiveRotateInstanceIdError
'
,
done
=>
{
it
(
'
dispatches requestRotateInstanceId and receiveRotateInstanceIdError
'
,
(
done
)
=>
{
mock
.
onGet
(
`
${
TEST_HOST
}
/endpoint.json`
,
{}).
replyOnce
(
500
,
{});
testAction
(
...
...
@@ -306,7 +306,7 @@ describe('Feature flags actions', () => {
});
describe
(
'
requestRotateInstanceId
'
,
()
=>
{
it
(
'
should commit REQUEST_ROTATE_INSTANCE_ID mutation
'
,
done
=>
{
it
(
'
should commit REQUEST_ROTATE_INSTANCE_ID mutation
'
,
(
done
)
=>
{
testAction
(
requestRotateInstanceId
,
null
,
...
...
@@ -319,7 +319,7 @@ describe('Feature flags actions', () => {
});
describe
(
'
receiveRotateInstanceIdSuccess
'
,
()
=>
{
it
(
'
should commit RECEIVE_ROTATE_INSTANCE_ID_SUCCESS mutation
'
,
done
=>
{
it
(
'
should commit RECEIVE_ROTATE_INSTANCE_ID_SUCCESS mutation
'
,
(
done
)
=>
{
testAction
(
receiveRotateInstanceIdSuccess
,
{
data
:
rotateData
,
headers
:
{}
},
...
...
@@ -337,7 +337,7 @@ describe('Feature flags actions', () => {
});
describe
(
'
receiveRotateInstanceIdError
'
,
()
=>
{
it
(
'
should commit RECEIVE_ROTATE_INSTANCE_ID_ERROR mutation
'
,
done
=>
{
it
(
'
should commit RECEIVE_ROTATE_INSTANCE_ID_ERROR mutation
'
,
(
done
)
=>
{
testAction
(
receiveRotateInstanceIdError
,
null
,
...
...
@@ -353,7 +353,7 @@ describe('Feature flags actions', () => {
let
mock
;
beforeEach
(()
=>
{
mockedState
.
featureFlags
=
getRequestData
.
feature_flags
.
map
(
flag
=>
({
mockedState
.
featureFlags
=
getRequestData
.
feature_flags
.
map
(
(
flag
)
=>
({
...
flag
,
scopes
:
mapToScopesViewModel
(
flag
.
scopes
||
[]),
}));
...
...
@@ -364,7 +364,7 @@ describe('Feature flags actions', () => {
mock
.
restore
();
});
describe
(
'
success
'
,
()
=>
{
it
(
'
dispatches updateFeatureFlag and receiveUpdateFeatureFlagSuccess
'
,
done
=>
{
it
(
'
dispatches updateFeatureFlag and receiveUpdateFeatureFlagSuccess
'
,
(
done
)
=>
{
mock
.
onPut
(
featureFlag
.
update_path
).
replyOnce
(
200
,
featureFlag
,
{});
testAction
(
...
...
@@ -387,7 +387,7 @@ describe('Feature flags actions', () => {
});
});
describe
(
'
error
'
,
()
=>
{
it
(
'
dispatches updateFeatureFlag and receiveUpdateFeatureFlagSuccess
'
,
done
=>
{
it
(
'
dispatches updateFeatureFlag and receiveUpdateFeatureFlagSuccess
'
,
(
done
)
=>
{
mock
.
onPut
(
featureFlag
.
update_path
).
replyOnce
(
500
);
testAction
(
...
...
@@ -412,13 +412,13 @@ describe('Feature flags actions', () => {
});
describe
(
'
updateFeatureFlag
'
,
()
=>
{
beforeEach
(()
=>
{
mockedState
.
featureFlags
=
getRequestData
.
feature_flags
.
map
(
f
=>
({
mockedState
.
featureFlags
=
getRequestData
.
feature_flags
.
map
(
(
f
)
=>
({
...
f
,
scopes
:
mapToScopesViewModel
(
f
.
scopes
||
[]),
}));
});
it
(
'
commits UPDATE_FEATURE_FLAG with the given flag
'
,
done
=>
{
it
(
'
commits UPDATE_FEATURE_FLAG with the given flag
'
,
(
done
)
=>
{
testAction
(
updateFeatureFlag
,
featureFlag
,
...
...
@@ -436,13 +436,13 @@ describe('Feature flags actions', () => {
});
describe
(
'
receiveUpdateFeatureFlagSuccess
'
,
()
=>
{
beforeEach
(()
=>
{
mockedState
.
featureFlags
=
getRequestData
.
feature_flags
.
map
(
f
=>
({
mockedState
.
featureFlags
=
getRequestData
.
feature_flags
.
map
(
(
f
)
=>
({
...
f
,
scopes
:
mapToScopesViewModel
(
f
.
scopes
||
[]),
}));
});
it
(
'
commits RECEIVE_UPDATE_FEATURE_FLAG_SUCCESS with the given flag
'
,
done
=>
{
it
(
'
commits RECEIVE_UPDATE_FEATURE_FLAG_SUCCESS with the given flag
'
,
(
done
)
=>
{
testAction
(
receiveUpdateFeatureFlagSuccess
,
featureFlag
,
...
...
@@ -460,13 +460,13 @@ describe('Feature flags actions', () => {
});
describe
(
'
receiveUpdateFeatureFlagError
'
,
()
=>
{
beforeEach
(()
=>
{
mockedState
.
featureFlags
=
getRequestData
.
feature_flags
.
map
(
f
=>
({
mockedState
.
featureFlags
=
getRequestData
.
feature_flags
.
map
(
(
f
)
=>
({
...
f
,
scopes
:
mapToScopesViewModel
(
f
.
scopes
||
[]),
}));
});
it
(
'
commits RECEIVE_UPDATE_FEATURE_FLAG_ERROR with the given flag id
'
,
done
=>
{
it
(
'
commits RECEIVE_UPDATE_FEATURE_FLAG_ERROR with the given flag id
'
,
(
done
)
=>
{
testAction
(
receiveUpdateFeatureFlagError
,
featureFlag
.
id
,
...
...
@@ -492,7 +492,7 @@ describe('Feature flags actions', () => {
Api
.
deleteFeatureFlagUserList
.
mockResolvedValue
();
});
it
(
'
should refresh the user lists
'
,
done
=>
{
it
(
'
should refresh the user lists
'
,
(
done
)
=>
{
testAction
(
deleteUserList
,
userList
,
...
...
@@ -509,7 +509,7 @@ describe('Feature flags actions', () => {
Api
.
deleteFeatureFlagUserList
.
mockRejectedValue
({
response
:
{
data
:
'
some error
'
}
});
});
it
(
'
should dispatch receiveDeleteUserListError
'
,
done
=>
{
it
(
'
should dispatch receiveDeleteUserListError
'
,
(
done
)
=>
{
testAction
(
deleteUserList
,
userList
,
...
...
@@ -529,7 +529,7 @@ describe('Feature flags actions', () => {
});
describe
(
'
receiveDeleteUserListError
'
,
()
=>
{
it
(
'
should commit RECEIVE_DELETE_USER_LIST_ERROR with the given list
'
,
done
=>
{
it
(
'
should commit RECEIVE_DELETE_USER_LIST_ERROR with the given list
'
,
(
done
)
=>
{
testAction
(
receiveDeleteUserListError
,
{
list
:
userList
,
error
:
'
mock error
'
},
...
...
@@ -547,7 +547,7 @@ describe('Feature flags actions', () => {
});
describe
(
'
clearAlert
'
,
()
=>
{
it
(
'
should commit RECEIVE_CLEAR_ALERT
'
,
done
=>
{
it
(
'
should commit RECEIVE_CLEAR_ALERT
'
,
(
done
)
=>
{
const
alertIndex
=
3
;
testAction
(
...
...
spec/frontend/feature_flags/store/index/mutations_spec.js
View file @
9180eaee
...
...
@@ -50,7 +50,7 @@ describe('Feature flags store Mutations', () => {
});
it
(
'
should set featureFlags with the transformed data
'
,
()
=>
{
const
expected
=
getRequestData
.
feature_flags
.
map
(
flag
=>
({
const
expected
=
getRequestData
.
feature_flags
.
map
(
(
flag
)
=>
({
...
flag
,
scopes
:
mapToScopesViewModel
(
flag
.
scopes
||
[]),
}));
...
...
@@ -183,7 +183,7 @@ describe('Feature flags store Mutations', () => {
describe
(
'
UPDATE_FEATURE_FLAG
'
,
()
=>
{
beforeEach
(()
=>
{
stateCopy
.
featureFlags
=
getRequestData
.
feature_flags
.
map
(
flag
=>
({
stateCopy
.
featureFlags
=
getRequestData
.
feature_flags
.
map
(
(
flag
)
=>
({
...
flag
,
scopes
:
mapToScopesViewModel
(
flag
.
scopes
||
[]),
}));
...
...
@@ -209,7 +209,7 @@ describe('Feature flags store Mutations', () => {
describe
(
'
RECEIVE_UPDATE_FEATURE_FLAG_SUCCESS
'
,
()
=>
{
const
runUpdate
=
(
stateCount
,
flagState
,
featureFlagUpdateParams
)
=>
{
stateCopy
.
featureFlags
=
getRequestData
.
feature_flags
.
map
(
flag
=>
({
stateCopy
.
featureFlags
=
getRequestData
.
feature_flags
.
map
(
(
flag
)
=>
({
...
flag
,
...
flagState
,
scopes
:
mapToScopesViewModel
(
flag
.
scopes
||
[]),
...
...
@@ -237,7 +237,7 @@ describe('Feature flags store Mutations', () => {
describe
(
'
RECEIVE_UPDATE_FEATURE_FLAG_ERROR
'
,
()
=>
{
beforeEach
(()
=>
{
stateCopy
.
featureFlags
=
getRequestData
.
feature_flags
.
map
(
flag
=>
({
stateCopy
.
featureFlags
=
getRequestData
.
feature_flags
.
map
(
(
flag
)
=>
({
...
flag
,
scopes
:
mapToScopesViewModel
(
flag
.
scopes
||
[]),
}));
...
...
spec/frontend/feature_flags/store/new/actions_spec.js
View file @
9180eaee
...
...
@@ -59,7 +59,7 @@ describe('Feature flags New Module Actions', () => {
});
describe
(
'
success
'
,
()
=>
{
it
(
'
dispatches requestCreateFeatureFlag and receiveCreateFeatureFlagSuccess
'
,
done
=>
{
it
(
'
dispatches requestCreateFeatureFlag and receiveCreateFeatureFlagSuccess
'
,
(
done
)
=>
{
const
convertedActionParams
=
mapFromScopesViewModel
(
actionParams
);
mock
.
onPost
(
`
${
TEST_HOST
}
/endpoint.json`
,
convertedActionParams
).
replyOnce
(
200
);
...
...
@@ -81,7 +81,7 @@ describe('Feature flags New Module Actions', () => {
);
});
it
(
'
sends strategies for new style feature flags
'
,
done
=>
{
it
(
'
sends strategies for new style feature flags
'
,
(
done
)
=>
{
const
newVersionFlagParams
=
{
name
:
'
name
'
,
description
:
'
description
'
,
...
...
@@ -120,7 +120,7 @@ describe('Feature flags New Module Actions', () => {
});
describe
(
'
error
'
,
()
=>
{
it
(
'
dispatches requestCreateFeatureFlag and receiveCreateFeatureFlagError
'
,
done
=>
{
it
(
'
dispatches requestCreateFeatureFlag and receiveCreateFeatureFlagError
'
,
(
done
)
=>
{
const
convertedActionParams
=
mapFromScopesViewModel
(
actionParams
);
mock
...
...
@@ -148,7 +148,7 @@ describe('Feature flags New Module Actions', () => {
});
describe
(
'
requestCreateFeatureFlag
'
,
()
=>
{
it
(
'
should commit REQUEST_CREATE_FEATURE_FLAG mutation
'
,
done
=>
{
it
(
'
should commit REQUEST_CREATE_FEATURE_FLAG mutation
'
,
(
done
)
=>
{
testAction
(
requestCreateFeatureFlag
,
null
,
...
...
@@ -161,7 +161,7 @@ describe('Feature flags New Module Actions', () => {
});
describe
(
'
receiveCreateFeatureFlagSuccess
'
,
()
=>
{
it
(
'
should commit RECEIVE_CREATE_FEATURE_FLAG_SUCCESS mutation
'
,
done
=>
{
it
(
'
should commit RECEIVE_CREATE_FEATURE_FLAG_SUCCESS mutation
'
,
(
done
)
=>
{
testAction
(
receiveCreateFeatureFlagSuccess
,
null
,
...
...
@@ -178,7 +178,7 @@ describe('Feature flags New Module Actions', () => {
});
describe
(
'
receiveCreateFeatureFlagError
'
,
()
=>
{
it
(
'
should commit RECEIVE_CREATE_FEATURE_FLAG_ERROR mutation
'
,
done
=>
{
it
(
'
should commit RECEIVE_CREATE_FEATURE_FLAG_ERROR mutation
'
,
(
done
)
=>
{
testAction
(
receiveCreateFeatureFlagError
,
'
There was an error
'
,
...
...
spec/frontend/feature_highlight/feature_highlight_helper_spec.js
View file @
9180eaee
...
...
@@ -44,7 +44,7 @@ describe('feature highlight helper', () => {
});
describe
(
'
inserted
'
,
()
=>
{
it
(
'
registers click event callback
'
,
done
=>
{
it
(
'
registers click event callback
'
,
(
done
)
=>
{
const
context
=
{
getAttribute
:
()
=>
'
popoverId
'
,
dataset
:
{
...
...
@@ -52,7 +52,7 @@ describe('feature highlight helper', () => {
},
};
jest
.
spyOn
(
$
.
fn
,
'
on
'
).
mockImplementation
(
event
=>
{
jest
.
spyOn
(
$
.
fn
,
'
on
'
).
mockImplementation
(
(
event
)
=>
{
expect
(
event
).
toEqual
(
'
click
'
);
done
();
});
...
...
spec/frontend/filtered_search/components/recent_searches_dropdown_content_spec.js
View file @
9180eaee
...
...
@@ -10,7 +10,7 @@ describe('Recent Searches Dropdown Content', () => {
const
findDropdownItems
=
()
=>
wrapper
.
findAll
({
ref
:
'
dropdownItem
'
});
const
findDropdownNote
=
()
=>
wrapper
.
find
({
ref
:
'
dropdownNote
'
});
const
createComponent
=
props
=>
{
const
createComponent
=
(
props
)
=>
{
wrapper
=
shallowMount
(
RecentSearchesDropdownContent
,
{
propsData
:
{
allowedKeys
:
IssuableFilteredSearchTokenKeys
.
getKeys
(),
...
...
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