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
19b0ba72
Commit
19b0ba72
authored
Dec 23, 2020
by
Lukas Eipert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Run prettier on 31 files - 69 of 73
Part of our prettier migration; changing the arrow-parens style.
parent
dc6c2412
Changes
32
Hide whitespace changes
Inline
Side-by-side
Showing
32 changed files
with
55 additions
and
88 deletions
+55
-88
.prettierignore
.prettierignore
+0
-33
spec/frontend/sidebar/components/assignees/collapsed_assignee_list_spec.js
...ebar/components/assignees/collapsed_assignee_list_spec.js
+1
-1
spec/frontend/sidebar/components/severity/severity_spec.js
spec/frontend/sidebar/components/severity/severity_spec.js
+1
-1
spec/frontend/sidebar/components/severity/sidebar_severity_spec.js
...tend/sidebar/components/severity/sidebar_severity_spec.js
+1
-1
spec/frontend/sidebar/components/time_tracking/time_tracker_spec.js
...end/sidebar/components/time_tracking/time_tracker_spec.js
+1
-1
spec/frontend/sidebar/confidential/edit_form_spec.js
spec/frontend/sidebar/confidential/edit_form_spec.js
+1
-1
spec/frontend/sidebar/lock/edit_form_buttons_spec.js
spec/frontend/sidebar/lock/edit_form_buttons_spec.js
+1
-1
spec/frontend/sidebar/lock/edit_form_spec.js
spec/frontend/sidebar/lock/edit_form_spec.js
+1
-1
spec/frontend/sidebar/lock/issuable_lock_form_spec.js
spec/frontend/sidebar/lock/issuable_lock_form_spec.js
+2
-2
spec/frontend/sidebar/participants_spec.js
spec/frontend/sidebar/participants_spec.js
+1
-1
spec/frontend/sidebar/reviewer_title_spec.js
spec/frontend/sidebar/reviewer_title_spec.js
+1
-1
spec/frontend/sidebar/sidebar_mediator_spec.js
spec/frontend/sidebar/sidebar_mediator_spec.js
+1
-1
spec/frontend/sidebar/sidebar_move_issue_spec.js
spec/frontend/sidebar/sidebar_move_issue_spec.js
+4
-4
spec/frontend/sidebar/subscriptions_spec.js
spec/frontend/sidebar/subscriptions_spec.js
+1
-1
spec/frontend/snippet/collapsible_input_spec.js
spec/frontend/snippet/collapsible_input_spec.js
+6
-6
spec/frontend/snippets/components/embed_dropdown_spec.js
spec/frontend/snippets/components/embed_dropdown_spec.js
+1
-1
spec/frontend/snippets/components/snippet_blob_actions_edit_spec.js
...end/snippets/components/snippet_blob_actions_edit_spec.js
+4
-4
spec/frontend/snippets/components/snippet_visibility_edit_spec.js
...ntend/snippets/components/snippet_visibility_edit_spec.js
+1
-1
spec/frontend/snippets/utils/blob_spec.js
spec/frontend/snippets/utils/blob_spec.js
+1
-1
spec/frontend/static_site_editor/components/edit_area_spec.js
.../frontend/static_site_editor/components/edit_area_spec.js
+2
-2
spec/frontend/static_site_editor/components/edit_meta_controls_spec.js
.../static_site_editor/components/edit_meta_controls_spec.js
+1
-1
spec/frontend/static_site_editor/graphql/resolvers/file_spec.js
...rontend/static_site_editor/graphql/resolvers/file_spec.js
+1
-1
spec/frontend/static_site_editor/services/load_source_content_spec.js
...d/static_site_editor/services/load_source_content_spec.js
+1
-1
spec/frontend/static_site_editor/services/submit_content_changes_spec.js
...tatic_site_editor/services/submit_content_changes_spec.js
+1
-1
spec/frontend/syntax_highlight_spec.js
spec/frontend/syntax_highlight_spec.js
+1
-1
spec/frontend/task_list_spec.js
spec/frontend/task_list_spec.js
+2
-2
spec/frontend/tooltips/components/tooltips_spec.js
spec/frontend/tooltips/components/tooltips_spec.js
+1
-1
spec/frontend/tooltips/index_spec.js
spec/frontend/tooltips/index_spec.js
+2
-2
spec/frontend/user_lists/components/add_user_modal_spec.js
spec/frontend/user_lists/components/add_user_modal_spec.js
+1
-1
spec/frontend/user_lists/components/edit_user_list_spec.js
spec/frontend/user_lists/components/edit_user_list_spec.js
+2
-2
spec/frontend/user_lists/components/new_user_list_spec.js
spec/frontend/user_lists/components/new_user_list_spec.js
+2
-2
spec/frontend/user_lists/components/user_list_spec.js
spec/frontend/user_lists/components/user_list_spec.js
+8
-8
No files found.
.prettierignore
View file @
19b0ba72
...
...
@@ -2256,39 +2256,6 @@ spec/frontend/shared/popover_spec.js
spec/frontend/shortcuts_spec.js
spec/frontend/sidebar/assignee_title_spec.js
## exciting-buck
spec/frontend/sidebar/components/assignees/collapsed_assignee_list_spec.js
spec/frontend/sidebar/components/severity/severity_spec.js
spec/frontend/sidebar/components/severity/sidebar_severity_spec.js
spec/frontend/sidebar/components/time_tracking/time_tracker_spec.js
spec/frontend/sidebar/confidential/edit_form_spec.js
spec/frontend/sidebar/lock/edit_form_buttons_spec.js
spec/frontend/sidebar/lock/edit_form_spec.js
spec/frontend/sidebar/lock/issuable_lock_form_spec.js
spec/frontend/sidebar/participants_spec.js
spec/frontend/sidebar/reviewer_title_spec.js
spec/frontend/sidebar/sidebar_mediator_spec.js
spec/frontend/sidebar/sidebar_move_issue_spec.js
spec/frontend/sidebar/subscriptions_spec.js
spec/frontend/snippet/collapsible_input_spec.js
spec/frontend/snippets/components/embed_dropdown_spec.js
spec/frontend/snippets/components/snippet_blob_actions_edit_spec.js
spec/frontend/snippets/components/snippet_visibility_edit_spec.js
spec/frontend/snippets/utils/blob_spec.js
spec/frontend/static_site_editor/components/edit_area_spec.js
spec/frontend/static_site_editor/components/edit_meta_controls_spec.js
spec/frontend/static_site_editor/graphql/resolvers/file_spec.js
spec/frontend/static_site_editor/services/load_source_content_spec.js
spec/frontend/static_site_editor/services/submit_content_changes_spec.js
spec/frontend/syntax_highlight_spec.js
spec/frontend/task_list_spec.js
spec/frontend/tooltips/components/tooltips_spec.js
spec/frontend/tooltips/index_spec.js
spec/frontend/user_lists/components/add_user_modal_spec.js
spec/frontend/user_lists/components/edit_user_list_spec.js
spec/frontend/user_lists/components/new_user_list_spec.js
spec/frontend/user_lists/components/user_list_spec.js
## priceless-margulis
spec/frontend/user_popovers_spec.js
spec/frontend/vue_alerts_spec.js
...
...
spec/frontend/sidebar/components/assignees/collapsed_assignee_list_spec.js
View file @
19b0ba72
...
...
@@ -101,7 +101,7 @@ describe('CollapsedAssigneeList component', () => {
beforeEach
(()
=>
{
users
=
UsersMockHelper
.
createNumberRandomUsers
(
3
);
userNames
=
users
.
map
(
x
=>
x
.
name
).
join
(
'
,
'
);
userNames
=
users
.
map
(
(
x
)
=>
x
.
name
).
join
(
'
,
'
);
});
describe
(
'
default
'
,
()
=>
{
...
...
spec/frontend/sidebar/components/severity/severity_spec.js
View file @
19b0ba72
...
...
@@ -24,7 +24,7 @@ describe('SeverityToken', () => {
const
findIcon
=
()
=>
wrapper
.
find
(
GlIcon
);
it
(
'
renders severity token for each severity type
'
,
()
=>
{
Object
.
values
(
INCIDENT_SEVERITY
).
forEach
(
severity
=>
{
Object
.
values
(
INCIDENT_SEVERITY
).
forEach
(
(
severity
)
=>
{
createComponent
({
severity
});
expect
(
findIcon
().
classes
()).
toContain
(
`icon-
${
severity
.
icon
}
`
);
expect
(
findIcon
().
attributes
(
'
name
'
)).
toBe
(
`severity-
${
severity
.
icon
}
`
);
...
...
spec/frontend/sidebar/components/severity/sidebar_severity_spec.js
View file @
19b0ba72
...
...
@@ -94,7 +94,7 @@ describe('SidebarSeverity', () => {
let
resolvePromise
;
wrapper
.
vm
.
$apollo
.
mutate
=
jest
.
fn
(
()
=>
new
Promise
(
resolve
=>
{
new
Promise
(
(
resolve
)
=>
{
resolvePromise
=
resolve
;
}),
);
...
...
spec/frontend/sidebar/components/time_tracking/time_tracker_spec.js
View file @
19b0ba72
...
...
@@ -6,7 +6,7 @@ import TimeTracker from '~/sidebar/components/time_tracking/time_tracker.vue';
describe
(
'
Issuable Time Tracker
'
,
()
=>
{
let
wrapper
;
const
findByTestId
=
testId
=>
wrapper
.
find
(
`[data-testid=
${
testId
}
]`
);
const
findByTestId
=
(
testId
)
=>
wrapper
.
find
(
`[data-testid=
${
testId
}
]`
);
const
findComparisonMeter
=
()
=>
findByTestId
(
'
compareMeter
'
).
attributes
(
'
title
'
);
const
findCollapsedState
=
()
=>
findByTestId
(
'
collapsedState
'
);
const
findTimeRemainingProgress
=
()
=>
findByTestId
(
'
timeRemainingProgress
'
);
...
...
spec/frontend/sidebar/confidential/edit_form_spec.js
View file @
19b0ba72
...
...
@@ -6,7 +6,7 @@ describe('Edit Form Dropdown', () => {
const
toggleForm
=
()
=>
{};
const
updateConfidentialAttribute
=
()
=>
{};
const
createComponent
=
props
=>
{
const
createComponent
=
(
props
)
=>
{
wrapper
=
shallowMount
(
EditForm
,
{
propsData
:
{
...
props
,
...
...
spec/frontend/sidebar/lock/edit_form_buttons_spec.js
View file @
19b0ba72
...
...
@@ -15,7 +15,7 @@ describe('EditFormButtons', () => {
let
issuableType
;
let
issuableDisplayName
;
const
setIssuableType
=
pageType
=>
{
const
setIssuableType
=
(
pageType
)
=>
{
issuableType
=
pageType
;
issuableDisplayName
=
issuableType
.
replace
(
/_/g
,
'
'
);
};
...
...
spec/frontend/sidebar/lock/edit_form_spec.js
View file @
19b0ba72
...
...
@@ -7,7 +7,7 @@ describe('Edit Form Dropdown', () => {
let
issuableType
;
// Either ISSUABLE_TYPE_ISSUE or ISSUABLE_TYPE_MR
let
issuableDisplayName
;
const
setIssuableType
=
pageType
=>
{
const
setIssuableType
=
(
pageType
)
=>
{
issuableType
=
pageType
;
issuableDisplayName
=
issuableType
.
replace
(
/_/g
,
'
'
);
};
...
...
spec/frontend/sidebar/lock/issuable_lock_form_spec.js
View file @
19b0ba72
...
...
@@ -12,7 +12,7 @@ describe('IssuableLockForm', () => {
let
store
;
let
issuableType
;
// Either ISSUABLE_TYPE_ISSUE or ISSUABLE_TYPE_MR
const
setIssuableType
=
pageType
=>
{
const
setIssuableType
=
(
pageType
)
=>
{
issuableType
=
pageType
;
};
...
...
@@ -23,7 +23,7 @@ describe('IssuableLockForm', () => {
const
findSidebarLockStatusTooltip
=
()
=>
getBinding
(
findSidebarCollapseIcon
().
element
,
'
gl-tooltip
'
);
const
initStore
=
isLocked
=>
{
const
initStore
=
(
isLocked
)
=>
{
if
(
issuableType
===
ISSUABLE_TYPE_ISSUE
)
{
store
=
createStore
();
store
.
getters
.
getNoteableData
.
targetType
=
'
issue
'
;
...
...
spec/frontend/sidebar/participants_spec.js
View file @
19b0ba72
...
...
@@ -21,7 +21,7 @@ describe('Participants', () => {
const
getCollapsedParticipantsCount
=
()
=>
wrapper
.
find
(
'
[data-testid="collapsed-count"]
'
);
const
mountComponent
=
propsData
=>
const
mountComponent
=
(
propsData
)
=>
shallowMount
(
Participants
,
{
propsData
,
});
...
...
spec/frontend/sidebar/reviewer_title_spec.js
View file @
19b0ba72
...
...
@@ -6,7 +6,7 @@ import Component from '~/sidebar/components/reviewers/reviewer_title.vue';
describe
(
'
ReviewerTitle component
'
,
()
=>
{
let
wrapper
;
const
createComponent
=
props
=>
{
const
createComponent
=
(
props
)
=>
{
return
shallowMount
(
Component
,
{
propsData
:
{
numberOfReviewers
:
0
,
...
...
spec/frontend/sidebar/sidebar_mediator_spec.js
View file @
19b0ba72
...
...
@@ -33,7 +33,7 @@ describe('Sidebar mediator', () => {
it
(
'
saves assignees
'
,
()
=>
{
mock
.
onPut
(
mediatorMockData
.
endpoint
).
reply
(
200
,
{});
return
mediator
.
saveAssignees
(
'
issue[assignee_ids]
'
).
then
(
resp
=>
{
return
mediator
.
saveAssignees
(
'
issue[assignee_ids]
'
).
then
(
(
resp
)
=>
{
expect
(
resp
.
status
).
toEqual
(
200
);
});
});
...
...
spec/frontend/sidebar/sidebar_move_issue_spec.js
View file @
19b0ba72
...
...
@@ -74,7 +74,7 @@ describe('SidebarMoveIssue', () => {
expect
(
test
.
sidebarMoveIssue
.
$dropdownToggle
.
data
(
'
deprecatedJQueryDropdown
'
)).
toBeTruthy
();
});
it
(
'
escapes html from project name
'
,
done
=>
{
it
(
'
escapes html from project name
'
,
(
done
)
=>
{
test
.
$toggleButton
.
dropdown
(
'
toggle
'
);
setImmediate
(()
=>
{
...
...
@@ -98,7 +98,7 @@ describe('SidebarMoveIssue', () => {
expect
(
test
.
$confirmButton
.
hasClass
(
'
is-loading
'
)).
toBe
(
true
);
});
it
(
'
should remove loading state from confirm button on failure
'
,
done
=>
{
it
(
'
should remove loading state from confirm button on failure
'
,
(
done
)
=>
{
jest
.
spyOn
(
window
,
'
Flash
'
).
mockImplementation
(()
=>
{});
jest
.
spyOn
(
test
.
mediator
,
'
moveIssue
'
).
mockReturnValue
(
Promise
.
reject
());
test
.
mediator
.
setMoveToProjectId
(
7
);
...
...
@@ -125,7 +125,7 @@ describe('SidebarMoveIssue', () => {
});
});
it
(
'
should set moveToProjectId on dropdown item "No project" click
'
,
done
=>
{
it
(
'
should set moveToProjectId on dropdown item "No project" click
'
,
(
done
)
=>
{
jest
.
spyOn
(
test
.
mediator
,
'
setMoveToProjectId
'
).
mockImplementation
(()
=>
{});
// Open the dropdown
...
...
@@ -141,7 +141,7 @@ describe('SidebarMoveIssue', () => {
});
});
it
(
'
should set moveToProjectId on dropdown item click
'
,
done
=>
{
it
(
'
should set moveToProjectId on dropdown item click
'
,
(
done
)
=>
{
jest
.
spyOn
(
test
.
mediator
,
'
setMoveToProjectId
'
).
mockImplementation
(()
=>
{});
// Open the dropdown
...
...
spec/frontend/sidebar/subscriptions_spec.js
View file @
19b0ba72
...
...
@@ -8,7 +8,7 @@ describe('Subscriptions', () => {
const
findToggleButton
=
()
=>
wrapper
.
find
(
ToggleButton
);
const
mountComponent
=
propsData
=>
const
mountComponent
=
(
propsData
)
=>
shallowMount
(
Subscriptions
,
{
propsData
,
});
...
...
spec/frontend/snippet/collapsible_input_spec.js
View file @
19b0ba72
...
...
@@ -38,12 +38,12 @@ describe('~/snippet/collapsible_input', () => {
setupCollapsibleInputs
();
});
const
findInput
=
el
=>
el
.
querySelector
(
'
textarea,input
'
);
const
findCollapsed
=
el
=>
el
.
querySelector
(
'
.js-collapsed
'
);
const
findExpanded
=
el
=>
el
.
querySelector
(
'
.js-expanded
'
);
const
findCollapsedInput
=
el
=>
findInput
(
findCollapsed
(
el
));
const
findExpandedInput
=
el
=>
findInput
(
findExpanded
(
el
));
const
focusIn
=
target
=>
target
.
dispatchEvent
(
new
Event
(
'
focusin
'
,
{
bubbles
:
true
}));
const
findInput
=
(
el
)
=>
el
.
querySelector
(
'
textarea,input
'
);
const
findCollapsed
=
(
el
)
=>
el
.
querySelector
(
'
.js-collapsed
'
);
const
findExpanded
=
(
el
)
=>
el
.
querySelector
(
'
.js-expanded
'
);
const
findCollapsedInput
=
(
el
)
=>
findInput
(
findCollapsed
(
el
));
const
findExpandedInput
=
(
el
)
=>
findInput
(
findExpanded
(
el
));
const
focusIn
=
(
target
)
=>
target
.
dispatchEvent
(
new
Event
(
'
focusin
'
,
{
bubbles
:
true
}));
const
expectIsCollapsed
=
(
el
,
isCollapsed
)
=>
{
expect
(
findCollapsed
(
el
).
classList
.
contains
(
'
d-none
'
)).
toEqual
(
!
isCollapsed
);
expect
(
findExpanded
(
el
).
classList
.
contains
(
'
d-none
'
)).
toEqual
(
isCollapsed
);
...
...
spec/frontend/snippets/components/embed_dropdown_spec.js
View file @
19b0ba72
...
...
@@ -26,7 +26,7 @@ describe('snippets/components/embed_dropdown', () => {
const
sections
=
[];
let
current
=
{};
wrapper
.
findAll
(
'
[data-testid="header"],[data-testid="input"]
'
).
wrappers
.
forEach
(
x
=>
{
wrapper
.
findAll
(
'
[data-testid="header"],[data-testid="input"]
'
).
wrappers
.
forEach
(
(
x
)
=>
{
const
type
=
x
.
attributes
(
'
data-testid
'
);
if
(
type
===
'
header
'
)
{
...
...
spec/frontend/snippets/components/snippet_blob_actions_edit_spec.js
View file @
19b0ba72
...
...
@@ -14,7 +14,7 @@ const TEST_BLOBS = [
createBlobFromTestEntry
(
testEntries
.
deleted
),
];
const
TEST_BLOBS_UNLOADED
=
TEST_BLOBS
.
map
(
blob
=>
({
...
blob
,
content
:
''
,
isLoaded
:
false
}));
const
TEST_BLOBS_UNLOADED
=
TEST_BLOBS
.
map
(
(
blob
)
=>
({
...
blob
,
content
:
''
,
isLoaded
:
false
}));
describe
(
'
snippets/components/snippet_blob_actions_edit
'
,
()
=>
{
let
wrapper
;
...
...
@@ -31,7 +31,7 @@ describe('snippets/components/snippet_blob_actions_edit', () => {
const
findLabel
=
()
=>
wrapper
.
find
(
'
label
'
);
const
findBlobEdits
=
()
=>
wrapper
.
findAll
(
SnippetBlobEdit
);
const
findBlobsData
=
()
=>
findBlobEdits
().
wrappers
.
map
(
x
=>
({
findBlobEdits
().
wrappers
.
map
(
(
x
)
=>
({
blob
:
x
.
props
(
'
blob
'
),
classes
:
x
.
classes
(),
}));
...
...
@@ -42,7 +42,7 @@ describe('snippets/components/snippet_blob_actions_edit', () => {
return
events
[
events
.
length
-
1
]?.[
0
];
};
const
buildBlobsDataExpectation
=
blobs
=>
const
buildBlobsDataExpectation
=
(
blobs
)
=>
blobs
.
map
((
blob
,
index
)
=>
({
blob
:
{
...
blob
,
...
...
@@ -50,7 +50,7 @@ describe('snippets/components/snippet_blob_actions_edit', () => {
},
classes
:
index
>
0
?
[
'
gl-mt-3
'
]
:
[],
}));
const
triggerBlobDelete
=
idx
=>
findBlobEdits
().
at
(
idx
).
vm
.
$emit
(
'
delete
'
);
const
triggerBlobDelete
=
(
idx
)
=>
findBlobEdits
().
at
(
idx
).
vm
.
$emit
(
'
delete
'
);
const
triggerBlobUpdate
=
(
idx
,
props
)
=>
findBlobEdits
().
at
(
idx
).
vm
.
$emit
(
'
blob-updated
'
,
props
);
afterEach
(()
=>
{
...
...
spec/frontend/snippets/components/snippet_visibility_edit_spec.js
View file @
19b0ba72
...
...
@@ -40,7 +40,7 @@ describe('Snippet Visibility Edit component', () => {
const
findLink
=
()
=>
wrapper
.
find
(
'
label
'
).
find
(
GlLink
);
const
findRadios
=
()
=>
wrapper
.
find
(
GlFormRadioGroup
).
findAll
(
GlFormRadio
);
const
findRadiosData
=
()
=>
findRadios
().
wrappers
.
map
(
x
=>
{
findRadios
().
wrappers
.
map
(
(
x
)
=>
{
return
{
value
:
x
.
find
(
'
input
'
).
attributes
(
'
value
'
),
icon
:
x
.
find
(
GlIcon
).
props
(
'
name
'
),
...
...
spec/frontend/snippets/utils/blob_spec.js
View file @
19b0ba72
...
...
@@ -2,7 +2,7 @@ import { cloneDeep } from 'lodash';
import
{
decorateBlob
,
createBlob
,
diffAll
}
from
'
~/snippets/utils/blob
'
;
import
{
testEntries
,
createBlobsFromTestEntries
}
from
'
../test_utils
'
;
jest
.
mock
(
'
lodash/uniqueId
'
,
()
=>
arg
=>
`
${
arg
}
fakeUniqueId`
);
jest
.
mock
(
'
lodash/uniqueId
'
,
()
=>
(
arg
)
=>
`
${
arg
}
fakeUniqueId`
);
const
TEST_RAW_BLOB
=
{
rawPath
:
'
/test/blob/7/raw
'
,
...
...
spec/frontend/static_site_editor/components/edit_area_spec.js
View file @
19b0ba72
...
...
@@ -22,7 +22,7 @@ import {
imageRoot
,
}
from
'
../mock_data
'
;
jest
.
mock
(
'
~/static_site_editor/services/formatter
'
,
()
=>
jest
.
fn
(
str
=>
`
${
str
}
format-pass`
));
jest
.
mock
(
'
~/static_site_editor/services/formatter
'
,
()
=>
jest
.
fn
(
(
str
)
=>
`
${
str
}
format-pass`
));
describe
(
'
~/static_site_editor/components/edit_area.vue
'
,
()
=>
{
let
wrapper
;
...
...
@@ -126,7 +126,7 @@ describe('~/static_site_editor/components/edit_area.vue', () => {
describe
(
'
when the mode changes
'
,
()
=>
{
let
resetInitialValue
;
const
setInitialMode
=
mode
=>
{
const
setInitialMode
=
(
mode
)
=>
{
wrapper
.
setData
({
editorMode
:
mode
});
};
...
...
spec/frontend/static_site_editor/components/edit_meta_controls_spec.js
View file @
19b0ba72
...
...
@@ -35,7 +35,7 @@ describe('~/static_site_editor/components/edit_meta_controls.vue', () => {
const
findGlFormInputTitle
=
()
=>
wrapper
.
find
(
GlFormInput
);
const
findGlDropdownDescriptionTemplate
=
()
=>
wrapper
.
find
(
GlDropdown
);
const
findAllDropdownItems
=
()
=>
wrapper
.
findAll
(
GlDropdownItem
);
const
findDropdownItemByIndex
=
index
=>
findAllDropdownItems
().
at
(
index
);
const
findDropdownItemByIndex
=
(
index
)
=>
findAllDropdownItems
().
at
(
index
);
const
findGlFormTextAreaDescription
=
()
=>
wrapper
.
find
(
GlFormTextarea
);
...
...
spec/frontend/static_site_editor/graphql/resolvers/file_spec.js
View file @
19b0ba72
...
...
@@ -14,7 +14,7 @@ describe('static_site_editor/graphql/resolvers/file', () => {
it
(
'
returns file content and title when fetching file successfully
'
,
()
=>
{
loadSourceContent
.
mockResolvedValueOnce
({
title
,
content
});
return
fileResolver
({
fullPath
:
projectId
},
{
path
:
sourcePath
}).
then
(
file
=>
{
return
fileResolver
({
fullPath
:
projectId
},
{
path
:
sourcePath
}).
then
(
(
file
)
=>
{
expect
(
file
).
toEqual
({
__typename
:
'
File
'
,
title
,
...
...
spec/frontend/static_site_editor/services/load_source_content_spec.js
View file @
19b0ba72
...
...
@@ -16,7 +16,7 @@ describe('loadSourceContent', () => {
beforeEach
(()
=>
{
jest
.
spyOn
(
Api
,
'
getRawFile
'
).
mockResolvedValue
({
data
:
sourceContent
});
return
loadSourceContent
({
projectId
,
sourcePath
}).
then
(
_result
=>
{
return
loadSourceContent
({
projectId
,
sourcePath
}).
then
(
(
_result
)
=>
{
result
=
_result
;
});
});
...
...
spec/frontend/static_site_editor/services/submit_content_changes_spec.js
View file @
19b0ba72
...
...
@@ -188,7 +188,7 @@ describe('submitContentChanges', () => {
let
result
;
beforeEach
(()
=>
{
return
submitContentChanges
(
buildPayload
()).
then
(
_result
=>
{
return
submitContentChanges
(
buildPayload
()).
then
(
(
_result
)
=>
{
result
=
_result
;
});
});
...
...
spec/frontend/syntax_highlight_spec.js
View file @
19b0ba72
...
...
@@ -4,7 +4,7 @@ import $ from 'jquery';
import
syntaxHighlight
from
'
~/syntax_highlight
'
;
describe
(
'
Syntax Highlighter
'
,
()
=>
{
const
stubUserColorScheme
=
value
=>
{
const
stubUserColorScheme
=
(
value
)
=>
{
if
(
window
.
gon
==
null
)
{
window
.
gon
=
{};
}
...
...
spec/frontend/task_list_spec.js
View file @
19b0ba72
...
...
@@ -93,7 +93,7 @@ describe('TaskList', () => {
});
describe
(
'
update
'
,
()
=>
{
it
(
'
should disable task list items and make a patch request then enable them again
'
,
done
=>
{
it
(
'
should disable task list items and make a patch request then enable them again
'
,
(
done
)
=>
{
const
response
=
{
data
:
{
lock_version
:
3
}
};
jest
.
spyOn
(
taskList
,
'
enableTaskListItems
'
).
mockImplementation
(()
=>
{});
jest
.
spyOn
(
taskList
,
'
disableTaskListItems
'
).
mockImplementation
(()
=>
{});
...
...
@@ -137,7 +137,7 @@ describe('TaskList', () => {
});
});
it
(
'
should handle request error and enable task list items
'
,
done
=>
{
it
(
'
should handle request error and enable task list items
'
,
(
done
)
=>
{
const
response
=
{
data
:
{
error
:
1
}
};
jest
.
spyOn
(
taskList
,
'
enableTaskListItems
'
).
mockImplementation
(()
=>
{});
jest
.
spyOn
(
taskList
,
'
onError
'
).
mockImplementation
(()
=>
{});
...
...
spec/frontend/tooltips/components/tooltips_spec.js
View file @
19b0ba72
...
...
@@ -18,7 +18,7 @@ describe('tooltips/components/tooltips.vue', () => {
...
attributes
,
};
Object
.
keys
(
defaults
).
forEach
(
name
=>
{
Object
.
keys
(
defaults
).
forEach
(
(
name
)
=>
{
target
.
setAttribute
(
name
,
defaults
[
name
]);
});
...
...
spec/frontend/tooltips/index_spec.js
View file @
19b0ba72
...
...
@@ -20,7 +20,7 @@ describe('tooltips/index.js', () => {
title
:
'
default title
'
,
};
Object
.
keys
(
attributes
).
forEach
(
name
=>
{
Object
.
keys
(
attributes
).
forEach
(
(
name
)
=>
{
target
.
setAttribute
(
name
,
attributes
[
name
]);
});
...
...
@@ -46,7 +46,7 @@ describe('tooltips/index.js', () => {
});
afterEach
(()
=>
{
document
.
body
.
childNodes
.
forEach
(
node
=>
node
.
remove
());
document
.
body
.
childNodes
.
forEach
(
(
node
)
=>
node
.
remove
());
destroy
();
});
...
...
spec/frontend/user_lists/components/add_user_modal_spec.js
View file @
19b0ba72
...
...
@@ -4,7 +4,7 @@ import AddUserModal from '~/user_lists/components/add_user_modal.vue';
describe
(
'
Add User Modal
'
,
()
=>
{
let
wrapper
;
const
click
=
testId
=>
wrapper
.
find
(
`[data-testid="
${
testId
}
"]`
).
trigger
(
'
click
'
);
const
click
=
(
testId
)
=>
wrapper
.
find
(
`[data-testid="
${
testId
}
"]`
).
trigger
(
'
click
'
);
beforeEach
(()
=>
{
wrapper
=
mount
(
AddUserModal
,
{
...
...
spec/frontend/user_lists/components/edit_user_list_spec.js
View file @
19b0ba72
...
...
@@ -19,9 +19,9 @@ localVue.use(Vuex);
describe
(
'
user_lists/components/edit_user_list
'
,
()
=>
{
let
wrapper
;
const
setInputValue
=
value
=>
wrapper
.
find
(
'
[data-testid="user-list-name"]
'
).
setValue
(
value
);
const
setInputValue
=
(
value
)
=>
wrapper
.
find
(
'
[data-testid="user-list-name"]
'
).
setValue
(
value
);
const
click
=
button
=>
wrapper
.
find
(
`[data-testid="
${
button
}
"]`
).
trigger
(
'
click
'
);
const
click
=
(
button
)
=>
wrapper
.
find
(
`[data-testid="
${
button
}
"]`
).
trigger
(
'
click
'
);
const
clickSave
=
()
=>
click
(
'
save-user-list
'
);
const
destroy
=
()
=>
wrapper
?.
destroy
();
...
...
spec/frontend/user_lists/components/new_user_list_spec.js
View file @
19b0ba72
...
...
@@ -18,9 +18,9 @@ localVue.use(Vuex);
describe
(
'
user_lists/components/new_user_list
'
,
()
=>
{
let
wrapper
;
const
setInputValue
=
value
=>
wrapper
.
find
(
'
[data-testid="user-list-name"]
'
).
setValue
(
value
);
const
setInputValue
=
(
value
)
=>
wrapper
.
find
(
'
[data-testid="user-list-name"]
'
).
setValue
(
value
);
const
click
=
button
=>
wrapper
.
find
(
`[data-testid="
${
button
}
"]`
).
trigger
(
'
click
'
);
const
click
=
(
button
)
=>
wrapper
.
find
(
`[data-testid="
${
button
}
"]`
).
trigger
(
'
click
'
);
beforeEach
(()
=>
{
wrapper
=
mount
(
NewUserList
,
{
...
...
spec/frontend/user_lists/components/user_list_spec.js
View file @
19b0ba72
...
...
@@ -16,7 +16,7 @@ Vue.use(Vuex);
describe
(
'
User List
'
,
()
=>
{
let
wrapper
;
const
click
=
testId
=>
wrapper
.
find
(
`[data-testid="
${
testId
}
"]`
).
trigger
(
'
click
'
);
const
click
=
(
testId
)
=>
wrapper
.
find
(
`[data-testid="
${
testId
}
"]`
).
trigger
(
'
click
'
);
const
findUserIds
=
()
=>
wrapper
.
findAll
(
'
[data-testid="user-id"]
'
);
...
...
@@ -38,7 +38,7 @@ describe('User List', () => {
beforeEach
(()
=>
{
Api
.
fetchFeatureFlagUserList
.
mockReturnValue
(
new
Promise
(
resolve
=>
{
new
Promise
(
(
resolve
)
=>
{
resolveFn
=
resolve
;
}),
);
...
...
@@ -110,15 +110,15 @@ describe('User List', () => {
});
it
(
'
should add user IDs to the user list
'
,
()
=>
{
newIds
.
forEach
(
id
=>
expect
(
receivedUserIds
).
toContain
(
id
));
newIds
.
forEach
(
(
id
)
=>
expect
(
receivedUserIds
).
toContain
(
id
));
});
it
(
'
should not remove existing user ids
'
,
()
=>
{
userIds
.
forEach
(
id
=>
expect
(
receivedUserIds
).
toContain
(
id
));
userIds
.
forEach
(
(
id
)
=>
expect
(
receivedUserIds
).
toContain
(
id
));
});
it
(
'
should not submit empty IDs
'
,
()
=>
{
parsedReceivedUserIds
.
forEach
(
id
=>
expect
(
id
).
not
.
toBe
(
''
));
parsedReceivedUserIds
.
forEach
(
(
id
)
=>
expect
(
id
).
not
.
toBe
(
''
));
});
it
(
'
should not create duplicate entries
'
,
()
=>
{
...
...
@@ -127,8 +127,8 @@ describe('User List', () => {
it
(
'
should display the new IDs
'
,
()
=>
{
const
userIdWrappers
=
findUserIds
();
newIds
.
forEach
(
id
=>
{
const
userIdWrapper
=
userIdWrappers
.
wrappers
.
find
(
w
=>
w
.
text
()
===
id
);
newIds
.
forEach
(
(
id
)
=>
{
const
userIdWrapper
=
userIdWrappers
.
wrappers
.
find
(
(
w
)
=>
w
.
text
()
===
id
);
expect
(
userIdWrapper
.
exists
()).
toBe
(
true
);
});
});
...
...
@@ -150,7 +150,7 @@ describe('User List', () => {
it
(
'
should not display the deleted user
'
,
()
=>
{
const
userIdWrappers
=
findUserIds
();
const
userIdWrapper
=
userIdWrappers
.
wrappers
.
find
(
w
=>
w
.
text
()
===
userIds
[
0
]);
const
userIdWrapper
=
userIdWrappers
.
wrappers
.
find
(
(
w
)
=>
w
.
text
()
===
userIds
[
0
]);
expect
(
userIdWrapper
).
toBeUndefined
();
});
});
...
...
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