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
e94556e9
Commit
e94556e9
authored
Dec 23, 2020
by
Lukas Eipert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Run prettier on 32 files - 59 of 73
Part of our prettier migration; changing the arrow-parens style.
parent
dc6c2412
Changes
33
Hide whitespace changes
Inline
Side-by-side
Showing
33 changed files
with
80 additions
and
114 deletions
+80
-114
.prettierignore
.prettierignore
+0
-34
spec/frontend/ide/components/activity_bar_spec.js
spec/frontend/ide/components/activity_bar_spec.js
+1
-1
spec/frontend/ide/components/branches/search_list_spec.js
spec/frontend/ide/components/branches/search_list_spec.js
+1
-1
spec/frontend/ide/components/commit_sidebar/actions_spec.js
spec/frontend/ide/components/commit_sidebar/actions_spec.js
+3
-3
spec/frontend/ide/components/commit_sidebar/list_item_spec.js
.../frontend/ide/components/commit_sidebar/list_item_spec.js
+5
-5
spec/frontend/ide/components/commit_sidebar/list_spec.js
spec/frontend/ide/components/commit_sidebar/list_spec.js
+1
-1
spec/frontend/ide/components/commit_sidebar/message_field_spec.js
...ntend/ide/components/commit_sidebar/message_field_spec.js
+8
-8
spec/frontend/ide/components/commit_sidebar/new_merge_request_option_spec.js
...omponents/commit_sidebar/new_merge_request_option_spec.js
+7
-7
spec/frontend/ide/components/commit_sidebar/radio_group_spec.js
...rontend/ide/components/commit_sidebar/radio_group_spec.js
+7
-7
spec/frontend/ide/components/commit_sidebar/success_message_spec.js
...end/ide/components/commit_sidebar/success_message_spec.js
+1
-1
spec/frontend/ide/components/error_message_spec.js
spec/frontend/ide/components/error_message_spec.js
+2
-2
spec/frontend/ide/components/file_row_extra_spec.js
spec/frontend/ide/components/file_row_extra_spec.js
+8
-8
spec/frontend/ide/components/file_templates/bar_spec.js
spec/frontend/ide/components/file_templates/bar_spec.js
+3
-3
spec/frontend/ide/components/file_templates/dropdown_spec.js
spec/frontend/ide/components/file_templates/dropdown_spec.js
+4
-4
spec/frontend/ide/components/ide_sidebar_nav_spec.js
spec/frontend/ide/components/ide_sidebar_nav_spec.js
+1
-1
spec/frontend/ide/components/ide_spec.js
spec/frontend/ide/components/ide_spec.js
+1
-1
spec/frontend/ide/components/ide_status_bar_spec.js
spec/frontend/ide/components/ide_status_bar_spec.js
+1
-1
spec/frontend/ide/components/ide_status_mr_spec.js
spec/frontend/ide/components/ide_status_mr_spec.js
+1
-1
spec/frontend/ide/components/ide_tree_list_spec.js
spec/frontend/ide/components/ide_tree_list_spec.js
+1
-1
spec/frontend/ide/components/jobs/detail/scroll_button_spec.js
...frontend/ide/components/jobs/detail/scroll_button_spec.js
+1
-1
spec/frontend/ide/components/jobs/detail_spec.js
spec/frontend/ide/components/jobs/detail_spec.js
+2
-2
spec/frontend/ide/components/jobs/item_spec.js
spec/frontend/ide/components/jobs/item_spec.js
+1
-1
spec/frontend/ide/components/jobs/list_spec.js
spec/frontend/ide/components/jobs/list_spec.js
+2
-2
spec/frontend/ide/components/jobs/stage_spec.js
spec/frontend/ide/components/jobs/stage_spec.js
+1
-1
spec/frontend/ide/components/merge_requests/list_spec.js
spec/frontend/ide/components/merge_requests/list_spec.js
+2
-2
spec/frontend/ide/components/nav_dropdown_button_spec.js
spec/frontend/ide/components/nav_dropdown_button_spec.js
+4
-4
spec/frontend/ide/components/nav_dropdown_spec.js
spec/frontend/ide/components/nav_dropdown_spec.js
+3
-3
spec/frontend/ide/components/new_dropdown/button_spec.js
spec/frontend/ide/components/new_dropdown/button_spec.js
+2
-2
spec/frontend/ide/components/new_dropdown/index_spec.js
spec/frontend/ide/components/new_dropdown/index_spec.js
+1
-1
spec/frontend/ide/components/new_dropdown/modal_spec.js
spec/frontend/ide/components/new_dropdown/modal_spec.js
+1
-1
spec/frontend/ide/components/new_dropdown/upload_spec.js
spec/frontend/ide/components/new_dropdown/upload_spec.js
+2
-2
spec/frontend/ide/components/panes/collapsible_sidebar_spec.js
...frontend/ide/components/panes/collapsible_sidebar_spec.js
+1
-1
spec/frontend/ide/components/panes/right_spec.js
spec/frontend/ide/components/panes/right_spec.js
+1
-1
No files found.
.prettierignore
View file @
e94556e9
...
...
@@ -1887,40 +1887,6 @@ spec/frontend/helpers/vuex_action_helper_spec.js
spec/frontend/helpers/wait_for_promises.js
spec/frontend/helpers/wait_using_real_timer.js
## condescending-haslett
spec/frontend/ide/components/activity_bar_spec.js
spec/frontend/ide/components/branches/search_list_spec.js
spec/frontend/ide/components/commit_sidebar/actions_spec.js
spec/frontend/ide/components/commit_sidebar/list_item_spec.js
spec/frontend/ide/components/commit_sidebar/list_spec.js
spec/frontend/ide/components/commit_sidebar/message_field_spec.js
spec/frontend/ide/components/commit_sidebar/new_merge_request_option_spec.js
spec/frontend/ide/components/commit_sidebar/radio_group_spec.js
spec/frontend/ide/components/commit_sidebar/success_message_spec.js
spec/frontend/ide/components/error_message_spec.js
spec/frontend/ide/components/file_row_extra_spec.js
spec/frontend/ide/components/file_templates/bar_spec.js
spec/frontend/ide/components/file_templates/dropdown_spec.js
spec/frontend/ide/components/ide_sidebar_nav_spec.js
spec/frontend/ide/components/ide_spec.js
spec/frontend/ide/components/ide_status_bar_spec.js
spec/frontend/ide/components/ide_status_mr_spec.js
spec/frontend/ide/components/ide_tree_list_spec.js
spec/frontend/ide/components/jobs/detail/scroll_button_spec.js
spec/frontend/ide/components/jobs/detail_spec.js
spec/frontend/ide/components/jobs/item_spec.js
spec/frontend/ide/components/jobs/list_spec.js
spec/frontend/ide/components/jobs/stage_spec.js
spec/frontend/ide/components/merge_requests/list_spec.js
spec/frontend/ide/components/nav_dropdown_button_spec.js
spec/frontend/ide/components/nav_dropdown_spec.js
spec/frontend/ide/components/new_dropdown/button_spec.js
spec/frontend/ide/components/new_dropdown/index_spec.js
spec/frontend/ide/components/new_dropdown/modal_spec.js
spec/frontend/ide/components/new_dropdown/upload_spec.js
spec/frontend/ide/components/panes/collapsible_sidebar_spec.js
spec/frontend/ide/components/panes/right_spec.js
## jovial-mirzakhani
spec/frontend/ide/components/repo_commit_section_spec.js
spec/frontend/ide/components/repo_editor_spec.js
...
...
spec/frontend/ide/components/activity_bar_spec.js
View file @
e94556e9
...
...
@@ -59,7 +59,7 @@ describe('IDE activity bar', () => {
expect
(
vm
.
$el
.
querySelector
(
'
.js-ide-edit-mode
'
).
classList
).
toContain
(
'
active
'
);
});
it
(
'
sets commit item active
'
,
done
=>
{
it
(
'
sets commit item active
'
,
(
done
)
=>
{
vm
.
$store
.
state
.
currentActivityView
=
leftSidebarViews
.
commit
.
name
;
vm
.
$nextTick
(()
=>
{
...
...
spec/frontend/ide/components/branches/search_list_spec.js
View file @
e94556e9
...
...
@@ -71,7 +71,7 @@ describe('IDE branches search list', () => {
it
(
'
renders check next to active branch
'
,
()
=>
{
const
activeBranch
=
'
regular
'
;
createComponent
({
branches
},
activeBranch
);
const
items
=
wrapper
.
findAll
(
Item
).
filter
(
w
=>
w
.
props
(
'
isActive
'
));
const
items
=
wrapper
.
findAll
(
Item
).
filter
(
(
w
)
=>
w
.
props
(
'
isActive
'
));
expect
(
items
.
length
).
toBe
(
1
);
expect
(
items
.
at
(
0
).
props
(
'
item
'
).
name
).
toBe
(
activeBranch
);
...
...
spec/frontend/ide/components/commit_sidebar/actions_spec.js
View file @
e94556e9
...
...
@@ -30,7 +30,7 @@ describe('IDE commit sidebar actions', () => {
vm
.
$store
.
state
.
currentProjectId
=
'
abcproject
'
;
const
proj
=
{
...
projectData
};
proj
.
branches
[
currentBranchId
]
=
branches
.
find
(
branch
=>
branch
.
name
===
currentBranchId
);
proj
.
branches
[
currentBranchId
]
=
branches
.
find
(
(
branch
)
=>
branch
.
name
===
currentBranchId
);
proj
.
empty_repo
=
emptyRepo
;
Vue
.
set
(
vm
.
$store
.
state
.
projects
,
'
abcproject
'
,
proj
);
...
...
@@ -72,7 +72,7 @@ describe('IDE commit sidebar actions', () => {
expect
(
findText
()).
toContain
(
'
Commit to master branch
'
);
});
it
(
'
hides merge request option when project merge requests are disabled
'
,
done
=>
{
it
(
'
hides merge request option when project merge requests are disabled
'
,
(
done
)
=>
{
createComponent
({
hasMR
:
false
});
vm
.
$nextTick
(()
=>
{
...
...
@@ -106,7 +106,7 @@ describe('IDE commit sidebar actions', () => {
expect
(
vm
.
$store
.
dispatch
).
not
.
toHaveBeenCalled
();
});
it
(
'
calls again after staged changes
'
,
done
=>
{
it
(
'
calls again after staged changes
'
,
(
done
)
=>
{
createComponent
({
currentBranchId
:
null
});
vm
.
$store
.
state
.
currentBranchId
=
'
master
'
;
...
...
spec/frontend/ide/components/commit_sidebar/list_item_spec.js
View file @
e94556e9
...
...
@@ -41,7 +41,7 @@ describe('Multi-file editor commit sidebar list item', () => {
expect
(
findPathText
()).
toContain
(
f
.
path
);
});
it
(
'
correctly renders renamed entries
'
,
done
=>
{
it
(
'
correctly renders renamed entries
'
,
(
done
)
=>
{
Vue
.
set
(
vm
.
file
,
'
prevName
'
,
'
Old name
'
);
vm
.
$nextTick
()
...
...
@@ -52,7 +52,7 @@ describe('Multi-file editor commit sidebar list item', () => {
.
catch
(
done
.
fail
);
});
it
(
'
correctly renders entry, the name of which did not change after rename (as within a folder)
'
,
done
=>
{
it
(
'
correctly renders entry, the name of which did not change after rename (as within a folder)
'
,
(
done
)
=>
{
Vue
.
set
(
vm
.
file
,
'
prevName
'
,
f
.
name
);
vm
.
$nextTick
()
...
...
@@ -63,7 +63,7 @@ describe('Multi-file editor commit sidebar list item', () => {
.
catch
(
done
.
fail
);
});
it
(
'
opens a closed file in the editor when clicking the file path
'
,
done
=>
{
it
(
'
opens a closed file in the editor when clicking the file path
'
,
(
done
)
=>
{
jest
.
spyOn
(
vm
,
'
openPendingTab
'
);
jest
.
spyOn
(
router
,
'
push
'
).
mockImplementation
(()
=>
{});
...
...
@@ -77,7 +77,7 @@ describe('Multi-file editor commit sidebar list item', () => {
});
});
it
(
'
calls updateViewer with diff when clicking file
'
,
done
=>
{
it
(
'
calls updateViewer with diff when clicking file
'
,
(
done
)
=>
{
jest
.
spyOn
(
vm
,
'
openFileInEditor
'
);
jest
.
spyOn
(
vm
,
'
updateViewer
'
);
jest
.
spyOn
(
router
,
'
push
'
).
mockImplementation
(()
=>
{});
...
...
@@ -134,7 +134,7 @@ describe('Multi-file editor commit sidebar list item', () => {
expect
(
vm
.
$el
.
querySelector
(
'
.is-active
'
)).
toBe
(
null
);
});
it
(
'
adds active class when keys match
'
,
done
=>
{
it
(
'
adds active class when keys match
'
,
(
done
)
=>
{
vm
.
keyPrefix
=
'
staged
'
;
vm
.
$nextTick
(()
=>
{
...
...
spec/frontend/ide/components/commit_sidebar/list_spec.js
View file @
e94556e9
...
...
@@ -31,7 +31,7 @@ describe('Multi-file editor commit sidebar list', () => {
});
describe
(
'
with a list of files
'
,
()
=>
{
beforeEach
(
done
=>
{
beforeEach
(
(
done
)
=>
{
const
f
=
file
(
'
file name
'
);
f
.
changed
=
true
;
vm
.
fileList
.
push
(
f
);
...
...
spec/frontend/ide/components/commit_sidebar/message_field_spec.js
View file @
e94556e9
...
...
@@ -23,7 +23,7 @@ describe('IDE commit message field', () => {
vm
.
$destroy
();
});
it
(
'
adds is-focused class on focus
'
,
done
=>
{
it
(
'
adds is-focused class on focus
'
,
(
done
)
=>
{
vm
.
$el
.
querySelector
(
'
textarea
'
).
focus
();
vm
.
$nextTick
(()
=>
{
...
...
@@ -33,7 +33,7 @@ describe('IDE commit message field', () => {
});
});
it
(
'
removed is-focused class on blur
'
,
done
=>
{
it
(
'
removed is-focused class on blur
'
,
(
done
)
=>
{
vm
.
$el
.
querySelector
(
'
textarea
'
).
focus
();
vm
.
$nextTick
()
...
...
@@ -66,7 +66,7 @@ describe('IDE commit message field', () => {
describe
(
'
highlights
'
,
()
=>
{
describe
(
'
subject line
'
,
()
=>
{
it
(
'
does not highlight less than 50 characters
'
,
done
=>
{
it
(
'
does not highlight less than 50 characters
'
,
(
done
)
=>
{
vm
.
text
=
'
text less than 50 chars
'
;
vm
.
$nextTick
()
...
...
@@ -81,7 +81,7 @@ describe('IDE commit message field', () => {
.
catch
(
done
.
fail
);
});
it
(
'
highlights characters over 50 length
'
,
done
=>
{
it
(
'
highlights characters over 50 length
'
,
(
done
)
=>
{
vm
.
text
=
'
text less than 50 chars that should not highlighted. text more than 50 should be highlighted
'
;
...
...
@@ -102,7 +102,7 @@ describe('IDE commit message field', () => {
});
describe
(
'
body text
'
,
()
=>
{
it
(
'
does not highlight body text less tan 72 characters
'
,
done
=>
{
it
(
'
does not highlight body text less tan 72 characters
'
,
(
done
)
=>
{
vm
.
text
=
'
subject line
\n
body content
'
;
vm
.
$nextTick
()
...
...
@@ -114,7 +114,7 @@ describe('IDE commit message field', () => {
.
catch
(
done
.
fail
);
});
it
(
'
highlights body text more than 72 characters
'
,
done
=>
{
it
(
'
highlights body text more than 72 characters
'
,
(
done
)
=>
{
vm
.
text
=
'
subject line
\n
body content that will be highlighted when it is more than 72 characters in length
'
;
...
...
@@ -128,7 +128,7 @@ describe('IDE commit message field', () => {
.
catch
(
done
.
fail
);
});
it
(
'
highlights body text & subject line
'
,
done
=>
{
it
(
'
highlights body text & subject line
'
,
(
done
)
=>
{
vm
.
text
=
'
text less than 50 chars that should not highlighted
\n
body content that will be highlighted when it is more than 72 characters in length
'
;
...
...
@@ -147,7 +147,7 @@ describe('IDE commit message field', () => {
});
describe
(
'
scrolling textarea
'
,
()
=>
{
it
(
'
updates transform of highlights
'
,
done
=>
{
it
(
'
updates transform of highlights
'
,
(
done
)
=>
{
vm
.
text
=
'
subject line
\n\n\n\n\n\n\n\n\n\n\n
body content
'
;
vm
.
$nextTick
()
...
...
spec/frontend/ide/components/commit_sidebar/new_merge_request_option_spec.js
View file @
e94556e9
...
...
@@ -17,7 +17,7 @@ describe('create new MR checkbox', () => {
]
=
{
foo
:
'
bar
'
};
};
const
setPermissions
=
permissions
=>
{
const
setPermissions
=
(
permissions
)
=>
{
store
.
state
.
projects
[
store
.
state
.
currentProjectId
].
userPermissions
=
permissions
;
};
...
...
@@ -33,7 +33,7 @@ describe('create new MR checkbox', () => {
vm
.
$store
.
state
.
currentBranchId
=
currentBranchId
;
store
.
state
.
projects
.
abcproject
.
branches
[
currentBranchId
]
=
branches
.
find
(
branch
=>
branch
.
name
===
currentBranchId
,
(
branch
)
=>
branch
.
name
===
currentBranchId
,
);
return
vm
.
$mount
();
...
...
@@ -69,7 +69,7 @@ describe('create new MR checkbox', () => {
expect
(
vm
.
$el
.
textContent
).
not
.
toBe
(
''
);
});
it
(
'
has new MR
'
,
done
=>
{
it
(
'
has new MR
'
,
(
done
)
=>
{
setMR
();
vm
.
$nextTick
()
...
...
@@ -93,7 +93,7 @@ describe('create new MR checkbox', () => {
expect
(
vm
.
$el
.
textContent
).
toBe
(
''
);
});
it
(
'
has new MR
'
,
done
=>
{
it
(
'
has new MR
'
,
(
done
)
=>
{
setMR
();
vm
.
$nextTick
()
...
...
@@ -118,7 +118,7 @@ describe('create new MR checkbox', () => {
expect
(
vm
.
$el
.
textContent
).
not
.
toBe
(
''
);
});
it
(
'
is rendered if MR exists
'
,
done
=>
{
it
(
'
is rendered if MR exists
'
,
(
done
)
=>
{
setMR
();
vm
.
$nextTick
()
...
...
@@ -141,7 +141,7 @@ describe('create new MR checkbox', () => {
expect
(
vm
.
$el
.
textContent
).
not
.
toBe
(
''
);
});
it
(
'
is hidden if MR exists
'
,
done
=>
{
it
(
'
is hidden if MR exists
'
,
(
done
)
=>
{
setMR
();
vm
.
$nextTick
()
...
...
@@ -165,7 +165,7 @@ describe('create new MR checkbox', () => {
expect
(
vm
.
$el
.
textContent
).
not
.
toBe
(
''
);
});
it
(
'
is hidden if MR exists
'
,
done
=>
{
it
(
'
is hidden if MR exists
'
,
(
done
)
=>
{
setMR
();
vm
.
$nextTick
()
...
...
spec/frontend/ide/components/commit_sidebar/radio_group_spec.js
View file @
e94556e9
...
...
@@ -7,7 +7,7 @@ describe('IDE commit sidebar radio group', () => {
let
vm
;
let
store
;
beforeEach
(
done
=>
{
beforeEach
(
(
done
)
=>
{
store
=
createStore
();
const
Component
=
Vue
.
extend
(
radioGroup
);
...
...
@@ -33,7 +33,7 @@ describe('IDE commit sidebar radio group', () => {
expect
(
vm
.
$el
.
textContent
).
toContain
(
'
test
'
);
});
it
(
'
uses slot if label is not present
'
,
done
=>
{
it
(
'
uses slot if label is not present
'
,
(
done
)
=>
{
vm
.
$destroy
();
vm
=
new
Vue
({
...
...
@@ -41,7 +41,7 @@ describe('IDE commit sidebar radio group', () => {
radioGroup
,
},
store
,
render
:
createElement
=>
render
:
(
createElement
)
=>
createElement
(
'
radio-group
'
,
{
props
:
{
value
:
'
1
'
}
},
'
Testing slot
'
),
});
...
...
@@ -54,7 +54,7 @@ describe('IDE commit sidebar radio group', () => {
});
});
it
(
'
updates store when changing radio button
'
,
done
=>
{
it
(
'
updates store when changing radio button
'
,
(
done
)
=>
{
vm
.
$el
.
querySelector
(
'
input
'
).
dispatchEvent
(
new
Event
(
'
change
'
));
Vue
.
nextTick
(()
=>
{
...
...
@@ -65,7 +65,7 @@ describe('IDE commit sidebar radio group', () => {
});
describe
(
'
with input
'
,
()
=>
{
beforeEach
(
done
=>
{
beforeEach
(
(
done
)
=>
{
vm
.
$destroy
();
const
Component
=
Vue
.
extend
(
radioGroup
);
...
...
@@ -89,7 +89,7 @@ describe('IDE commit sidebar radio group', () => {
expect
(
vm
.
$el
.
querySelector
(
'
.form-control
'
)).
not
.
toBeNull
();
});
it
(
'
hides input when commitAction doesnt match value
'
,
done
=>
{
it
(
'
hides input when commitAction doesnt match value
'
,
(
done
)
=>
{
store
.
state
.
commit
.
commitAction
=
'
2
'
;
Vue
.
nextTick
(()
=>
{
...
...
@@ -98,7 +98,7 @@ describe('IDE commit sidebar radio group', () => {
});
});
it
(
'
updates branch name in store on input
'
,
done
=>
{
it
(
'
updates branch name in store on input
'
,
(
done
)
=>
{
const
input
=
vm
.
$el
.
querySelector
(
'
.form-control
'
);
input
.
value
=
'
testing-123
'
;
input
.
dispatchEvent
(
new
Event
(
'
input
'
));
...
...
spec/frontend/ide/components/commit_sidebar/success_message_spec.js
View file @
e94556e9
...
...
@@ -23,7 +23,7 @@ describe('IDE commit panel successful commit state', () => {
vm
.
$destroy
();
});
it
(
'
renders last commit message when it exists
'
,
done
=>
{
it
(
'
renders last commit message when it exists
'
,
(
done
)
=>
{
vm
.
$store
.
state
.
lastCommitMsg
=
'
testing commit message
'
;
Vue
.
nextTick
(()
=>
{
...
...
spec/frontend/ide/components/error_message_spec.js
View file @
e94556e9
...
...
@@ -10,7 +10,7 @@ describe('IDE error message component', () => {
let
wrapper
;
const
setErrorMessageMock
=
jest
.
fn
();
const
createComponent
=
messageProps
=>
{
const
createComponent
=
(
messageProps
)
=>
{
const
fakeStore
=
new
Vuex
.
Store
({
actions
:
{
setErrorMessage
:
setErrorMessageMock
},
});
...
...
@@ -103,7 +103,7 @@ describe('IDE error message component', () => {
let
resolveAction
;
actionMock
.
mockImplementation
(
()
=>
new
Promise
(
resolve
=>
{
new
Promise
(
(
resolve
)
=>
{
resolveAction
=
resolve
;
}),
);
...
...
spec/frontend/ide/components/file_row_extra_spec.js
View file @
e94556e9
...
...
@@ -70,7 +70,7 @@ describe('IDE extra file row component', () => {
expect
(
vm
.
$el
.
querySelector
(
'
.ide-tree-changes
'
)).
toBe
(
null
);
});
it
(
'
does not show when tree is open
'
,
done
=>
{
it
(
'
does not show when tree is open
'
,
(
done
)
=>
{
vm
.
file
.
type
=
'
tree
'
;
vm
.
file
.
opened
=
true
;
changesCount
=
1
;
...
...
@@ -82,7 +82,7 @@ describe('IDE extra file row component', () => {
});
});
it
(
'
shows for trees with changes
'
,
done
=>
{
it
(
'
shows for trees with changes
'
,
(
done
)
=>
{
vm
.
file
.
type
=
'
tree
'
;
vm
.
file
.
opened
=
false
;
changesCount
=
1
;
...
...
@@ -100,7 +100,7 @@ describe('IDE extra file row component', () => {
expect
(
vm
.
$el
.
querySelector
(
'
.file-changed-icon
'
)).
toBe
(
null
);
});
it
(
'
shows when file is changed
'
,
done
=>
{
it
(
'
shows when file is changed
'
,
(
done
)
=>
{
vm
.
file
.
changed
=
true
;
vm
.
$nextTick
(()
=>
{
...
...
@@ -110,7 +110,7 @@ describe('IDE extra file row component', () => {
});
});
it
(
'
shows when file is staged
'
,
done
=>
{
it
(
'
shows when file is staged
'
,
(
done
)
=>
{
vm
.
file
.
staged
=
true
;
vm
.
$nextTick
(()
=>
{
...
...
@@ -120,7 +120,7 @@ describe('IDE extra file row component', () => {
});
});
it
(
'
shows when file is a tempFile
'
,
done
=>
{
it
(
'
shows when file is a tempFile
'
,
(
done
)
=>
{
vm
.
file
.
tempFile
=
true
;
vm
.
$nextTick
(()
=>
{
...
...
@@ -130,7 +130,7 @@ describe('IDE extra file row component', () => {
});
});
it
(
'
shows when file is renamed
'
,
done
=>
{
it
(
'
shows when file is renamed
'
,
(
done
)
=>
{
vm
.
file
.
prevPath
=
'
original-file
'
;
vm
.
$nextTick
(()
=>
{
...
...
@@ -140,7 +140,7 @@ describe('IDE extra file row component', () => {
});
});
it
(
'
hides when file is renamed
'
,
done
=>
{
it
(
'
hides when file is renamed
'
,
(
done
)
=>
{
vm
.
file
.
prevPath
=
'
original-file
'
;
vm
.
file
.
type
=
'
tree
'
;
...
...
@@ -157,7 +157,7 @@ describe('IDE extra file row component', () => {
expect
(
vm
.
$el
.
querySelector
(
'
[data-testid="git-merge-icon"]
'
)).
toBe
(
null
);
});
it
(
'
shows when a merge request change
'
,
done
=>
{
it
(
'
shows when a merge request change
'
,
(
done
)
=>
{
vm
.
file
.
mrChange
=
true
;
vm
.
$nextTick
(()
=>
{
...
...
spec/frontend/ide/components/file_templates/bar_spec.js
View file @
e94556e9
...
...
@@ -46,7 +46,7 @@ describe('IDE file templates bar component', () => {
});
describe
(
'
template dropdown
'
,
()
=>
{
beforeEach
(
done
=>
{
beforeEach
(
(
done
)
=>
{
vm
.
$store
.
state
.
fileTemplates
.
templates
=
[
{
name
:
'
test
'
,
...
...
@@ -75,7 +75,7 @@ describe('IDE file templates bar component', () => {
});
});
it
(
'
shows undo button if updateSuccess is true
'
,
done
=>
{
it
(
'
shows undo button if updateSuccess is true
'
,
(
done
)
=>
{
vm
.
$store
.
state
.
fileTemplates
.
updateSuccess
=
true
;
vm
.
$nextTick
(()
=>
{
...
...
@@ -93,7 +93,7 @@ describe('IDE file templates bar component', () => {
expect
(
vm
.
undoFileTemplate
).
toHaveBeenCalled
();
});
it
(
'
calls setSelectedTemplateType if activeFile name matches a template
'
,
done
=>
{
it
(
'
calls setSelectedTemplateType if activeFile name matches a template
'
,
(
done
)
=>
{
const
fileName
=
'
.gitlab-ci.yml
'
;
jest
.
spyOn
(
vm
,
'
setSelectedTemplateType
'
).
mockImplementation
(()
=>
{});
...
...
spec/frontend/ide/components/file_templates/dropdown_spec.js
View file @
e94556e9
...
...
@@ -109,7 +109,7 @@ describe('IDE file templates dropdown component', () => {
});
const
items
=
findItemButtons
();
expect
(
items
.
wrappers
.
map
(
x
=>
x
.
text
())).
toEqual
(
templates
.
map
(
x
=>
x
.
name
));
expect
(
items
.
wrappers
.
map
(
(
x
)
=>
x
.
text
())).
toEqual
(
templates
.
map
((
x
)
=>
x
.
name
));
});
it
(
'
searches template data
'
,
()
=>
{
...
...
@@ -124,7 +124,7 @@ describe('IDE file templates dropdown component', () => {
const
items
=
findItemButtons
();
expect
(
items
.
length
).
toBe
(
matches
.
length
);
expect
(
items
.
wrappers
.
map
(
x
=>
x
.
text
())).
toEqual
(
matches
);
expect
(
items
.
wrappers
.
map
(
(
x
)
=>
x
.
text
())).
toEqual
(
matches
);
});
});
...
...
@@ -151,7 +151,7 @@ describe('IDE file templates dropdown component', () => {
const
items
=
findItemButtons
();
expect
(
items
.
length
).
toBe
(
data
.
length
);
expect
(
items
.
wrappers
.
map
(
x
=>
x
.
text
())).
toEqual
(
data
.
map
(
x
=>
x
.
name
));
expect
(
items
.
wrappers
.
map
(
(
x
)
=>
x
.
text
())).
toEqual
(
data
.
map
((
x
)
=>
x
.
name
));
});
it
(
'
renders input when `searchable` is true
'
,
()
=>
{
...
...
@@ -169,7 +169,7 @@ describe('IDE file templates dropdown component', () => {
const
items
=
findItemButtons
();
expect
(
items
.
length
).
toBe
(
matches
.
length
);
expect
(
items
.
wrappers
.
map
(
x
=>
x
.
text
())).
toEqual
(
matches
);
expect
(
items
.
wrappers
.
map
(
(
x
)
=>
x
.
text
())).
toEqual
(
matches
);
});
});
});
...
...
spec/frontend/ide/components/ide_sidebar_nav_spec.js
View file @
e94556e9
...
...
@@ -48,7 +48,7 @@ describe('ide/components/ide_sidebar_nav', () => {
const
findButtons
=
()
=>
wrapper
.
findAll
(
'
li button
'
);
const
findButtonsData
=
()
=>
findButtons
().
wrappers
.
map
(
button
=>
{
findButtons
().
wrappers
.
map
(
(
button
)
=>
{
return
{
title
:
button
.
attributes
(
'
title
'
),
ariaLabel
:
button
.
attributes
(
'
aria-label
'
),
...
...
spec/frontend/ide/components/ide_spec.js
View file @
e94556e9
...
...
@@ -25,7 +25,7 @@ describe('WebIDE', () => {
tree
:
[],
loading
:
false
,
};
Object
.
keys
(
state
).
forEach
(
key
=>
{
Object
.
keys
(
state
).
forEach
(
(
key
)
=>
{
store
.
state
[
key
]
=
state
[
key
];
});
...
...
spec/frontend/ide/components/ide_status_bar_spec.js
View file @
e94556e9
...
...
@@ -73,7 +73,7 @@ describe('ideStatusBar', () => {
});
describe
(
'
pipeline status
'
,
()
=>
{
it
(
'
opens right sidebar on clicking icon
'
,
done
=>
{
it
(
'
opens right sidebar on clicking icon
'
,
(
done
)
=>
{
jest
.
spyOn
(
vm
,
'
openRightPane
'
).
mockImplementation
(()
=>
{});
Vue
.
set
(
vm
.
$store
.
state
.
pipelines
,
'
latestPipeline
'
,
{
details
:
{
...
...
spec/frontend/ide/components/ide_status_mr_spec.js
View file @
e94556e9
...
...
@@ -9,7 +9,7 @@ const TEST_URL = `${TEST_HOST}merge-requests/9001`;
describe
(
'
ide/components/ide_status_mr
'
,
()
=>
{
let
wrapper
;
const
createComponent
=
props
=>
{
const
createComponent
=
(
props
)
=>
{
wrapper
=
shallowMount
(
IdeStatusMr
,
{
propsData
:
props
,
});
...
...
spec/frontend/ide/components/ide_tree_list_spec.js
View file @
e94556e9
...
...
@@ -41,7 +41,7 @@ describe('IDE tree list', () => {
vm
.
$mount
();
});
it
(
'
renders loading indicator
'
,
done
=>
{
it
(
'
renders loading indicator
'
,
(
done
)
=>
{
store
.
state
.
trees
[
'
abcproject/master
'
].
loading
=
true
;
vm
.
$nextTick
(()
=>
{
...
...
spec/frontend/ide/components/jobs/detail/scroll_button_spec.js
View file @
e94556e9
...
...
@@ -5,7 +5,7 @@ import ScrollButton from '~/ide/components/jobs/detail/scroll_button.vue';
describe
(
'
IDE job log scroll button
'
,
()
=>
{
let
wrapper
;
const
createComponent
=
props
=>
{
const
createComponent
=
(
props
)
=>
{
wrapper
=
shallowMount
(
ScrollButton
,
{
propsData
:
{
direction
:
'
up
'
,
...
...
spec/frontend/ide/components/jobs/detail_spec.js
View file @
e94556e9
...
...
@@ -48,7 +48,7 @@ describe('IDE jobs detail view', () => {
expect
(
vm
.
$el
.
querySelector
(
'
.bash
'
).
textContent
).
toContain
(
'
testing
'
);
});
it
(
'
renders empty message output
'
,
done
=>
{
it
(
'
renders empty message output
'
,
(
done
)
=>
{
vm
.
$store
.
state
.
pipelines
.
detailJob
.
output
=
''
;
vm
.
$nextTick
(()
=>
{
...
...
@@ -68,7 +68,7 @@ describe('IDE jobs detail view', () => {
expect
(
vm
.
$el
.
querySelector
(
'
.bash
'
).
style
.
display
).
toBe
(
'
none
'
);
});
it
(
'
hide loading icon when isLoading is false
'
,
done
=>
{
it
(
'
hide loading icon when isLoading is false
'
,
(
done
)
=>
{
vm
.
$store
.
state
.
pipelines
.
detailJob
.
isLoading
=
false
;
vm
.
$nextTick
(()
=>
{
...
...
spec/frontend/ide/components/jobs/item_spec.js
View file @
e94556e9
...
...
@@ -27,7 +27,7 @@ describe('IDE jobs item', () => {
expect
(
vm
.
$el
.
querySelector
(
'
[data-testid="status_success_borderless-icon"]
'
)).
not
.
toBe
(
null
);
});
it
(
'
does not render view logs button if not started
'
,
done
=>
{
it
(
'
does not render view logs button if not started
'
,
(
done
)
=>
{
vm
.
job
.
started
=
false
;
vm
.
$nextTick
(()
=>
{
...
...
spec/frontend/ide/components/jobs/list_spec.js
View file @
e94556e9
...
...
@@ -36,7 +36,7 @@ describe('IDE stages list', () => {
status
:
{
icon
:
'
status_success
'
},
}));
const
createComponent
=
props
=>
{
const
createComponent
=
(
props
)
=>
{
wrapper
=
shallowMount
(
StageList
,
{
propsData
:
{
...
defaultProps
,
...
...
@@ -48,7 +48,7 @@ describe('IDE stages list', () => {
};
afterEach
(()
=>
{
Object
.
values
(
storeActions
).
forEach
(
actionMock
=>
actionMock
.
mockClear
());
Object
.
values
(
storeActions
).
forEach
(
(
actionMock
)
=>
actionMock
.
mockClear
());
});
afterAll
(()
=>
{
...
...
spec/frontend/ide/components/jobs/stage_spec.js
View file @
e94556e9
...
...
@@ -20,7 +20,7 @@ describe('IDE pipeline stage', () => {
const
findHeader
=
()
=>
wrapper
.
find
({
ref
:
'
cardHeader
'
});
const
findJobList
=
()
=>
wrapper
.
find
({
ref
:
'
jobList
'
});
const
createComponent
=
props
=>
{
const
createComponent
=
(
props
)
=>
{
wrapper
=
shallowMount
(
Stage
,
{
propsData
:
{
...
defaultProps
,
...
...
spec/frontend/ide/components/merge_requests/list_spec.js
View file @
e94556e9
...
...
@@ -151,8 +151,8 @@ describe('IDE merge requests list', () => {
it
(
'
shows search types
'
,
()
=>
{
const
buttons
=
findSearchTypeButtons
();
expect
(
buttons
.
wrappers
.
map
(
x
=>
x
.
text
().
trim
())).
toEqual
(
wrapper
.
vm
.
$options
.
searchTypes
.
map
(
x
=>
x
.
label
),
expect
(
buttons
.
wrappers
.
map
(
(
x
)
=>
x
.
text
().
trim
())).
toEqual
(
wrapper
.
vm
.
$options
.
searchTypes
.
map
(
(
x
)
=>
x
.
label
),
);
});
...
...
spec/frontend/ide/components/nav_dropdown_button_spec.js
View file @
e94556e9
...
...
@@ -23,7 +23,7 @@ describe('NavDropdown', () => {
vm
.
$mount
();
};
const
findIcon
=
name
=>
vm
.
$el
.
querySelector
(
`[data-testid="
${
name
}
-icon"]`
);
const
findIcon
=
(
name
)
=>
vm
.
$el
.
querySelector
(
`[data-testid="
${
name
}
-icon"]`
);
const
findMRIcon
=
()
=>
findIcon
(
'
merge-request
'
);
const
findBranchIcon
=
()
=>
findIcon
(
'
branch
'
);
...
...
@@ -36,7 +36,7 @@ describe('NavDropdown', () => {
expect
(
trimText
(
vm
.
$el
.
textContent
)).
toEqual
(
'
- -
'
);
});
it
(
'
renders branch name, if state has currentBranchId
'
,
done
=>
{
it
(
'
renders branch name, if state has currentBranchId
'
,
(
done
)
=>
{
vm
.
$store
.
state
.
currentBranchId
=
TEST_BRANCH_ID
;
vm
.
$nextTick
()
...
...
@@ -47,7 +47,7 @@ describe('NavDropdown', () => {
.
catch
(
done
.
fail
);
});
it
(
'
renders mr id, if state has currentMergeRequestId
'
,
done
=>
{
it
(
'
renders mr id, if state has currentMergeRequestId
'
,
(
done
)
=>
{
vm
.
$store
.
state
.
currentMergeRequestId
=
TEST_MR_ID
;
vm
.
$nextTick
()
...
...
@@ -58,7 +58,7 @@ describe('NavDropdown', () => {
.
catch
(
done
.
fail
);
});
it
(
'
renders branch and mr, if state has both
'
,
done
=>
{
it
(
'
renders branch and mr, if state has both
'
,
(
done
)
=>
{
vm
.
$store
.
state
.
currentBranchId
=
TEST_BRANCH_ID
;
vm
.
$store
.
state
.
currentMergeRequestId
=
TEST_MR_ID
;
...
...
spec/frontend/ide/components/nav_dropdown_spec.js
View file @
e94556e9
...
...
@@ -39,7 +39,7 @@ describe('IDE NavDropdown', () => {
});
};
const
findIcon
=
name
=>
wrapper
.
find
(
`[data-testid="
${
name
}
-icon"]`
);
const
findIcon
=
(
name
)
=>
wrapper
.
find
(
`[data-testid="
${
name
}
-icon"]`
);
const
findMRIcon
=
()
=>
findIcon
(
'
merge-request
'
);
const
findNavForm
=
()
=>
wrapper
.
find
(
'
.ide-nav-form
'
);
const
showDropdown
=
()
=>
{
...
...
@@ -58,7 +58,7 @@ describe('IDE NavDropdown', () => {
expect
(
findNavForm
().
exists
()).
toBe
(
false
);
});
it
(
'
renders nav form when show.bs.dropdown
'
,
done
=>
{
it
(
'
renders nav form when show.bs.dropdown
'
,
(
done
)
=>
{
showDropdown
();
wrapper
.
vm
...
...
@@ -70,7 +70,7 @@ describe('IDE NavDropdown', () => {
.
catch
(
done
.
fail
);
});
it
(
'
destroys nav form when closed
'
,
done
=>
{
it
(
'
destroys nav form when closed
'
,
(
done
)
=>
{
showDropdown
();
hideDropdown
();
...
...
spec/frontend/ide/components/new_dropdown/button_spec.js
View file @
e94556e9
...
...
@@ -37,7 +37,7 @@ describe('IDE new entry dropdown button component', () => {
expect
(
vm
.
$emit
).
toHaveBeenCalledWith
(
'
click
'
);
});
it
(
'
hides label if showLabel is false
'
,
done
=>
{
it
(
'
hides label if showLabel is false
'
,
(
done
)
=>
{
vm
.
showLabel
=
false
;
vm
.
$nextTick
(()
=>
{
...
...
@@ -52,7 +52,7 @@ describe('IDE new entry dropdown button component', () => {
expect
(
vm
.
tooltipTitle
).
toBe
(
''
);
});
it
(
'
returns label
'
,
done
=>
{
it
(
'
returns label
'
,
(
done
)
=>
{
vm
.
showLabel
=
false
;
vm
.
$nextTick
(()
=>
{
...
...
spec/frontend/ide/components/new_dropdown/index_spec.js
View file @
e94556e9
...
...
@@ -57,7 +57,7 @@ describe('new dropdown component', () => {
});
describe
(
'
isOpen
'
,
()
=>
{
it
(
'
scrolls dropdown into view
'
,
done
=>
{
it
(
'
scrolls dropdown into view
'
,
(
done
)
=>
{
jest
.
spyOn
(
vm
.
$refs
.
dropdownMenu
,
'
scrollIntoView
'
).
mockImplementation
(()
=>
{});
vm
.
isOpen
=
true
;
...
...
spec/frontend/ide/components/new_dropdown/modal_spec.js
View file @
e94556e9
...
...
@@ -19,7 +19,7 @@ describe('new file modal component', () => {
${
'
tree
'
}
|
${
'
Create new directory
'
}
|
${
'
Create directory
'
}
|
${
false
}
${
'
blob
'
}
|
${
'
Create new file
'
}
|
${
'
Create file
'
}
|
${
true
}
`
(
'
$entryType
'
,
({
entryType
,
modalTitle
,
btnTitle
,
showsFileTemplates
})
=>
{
beforeEach
(
done
=>
{
beforeEach
(
(
done
)
=>
{
const
store
=
createStore
();
vm
=
createComponentWithStore
(
Component
,
store
).
$mount
();
...
...
spec/frontend/ide/components/new_dropdown/upload_spec.js
View file @
e94556e9
...
...
@@ -69,8 +69,8 @@ describe('new dropdown upload', () => {
jest
.
spyOn
(
FileReader
.
prototype
,
'
readAsText
'
);
});
it
(
'
calls readAsText and creates file in plain text (without encoding) if the file content is plain text
'
,
done
=>
{
const
waitForCreate
=
new
Promise
(
resolve
=>
vm
.
$on
(
'
create
'
,
resolve
));
it
(
'
calls readAsText and creates file in plain text (without encoding) if the file content is plain text
'
,
(
done
)
=>
{
const
waitForCreate
=
new
Promise
(
(
resolve
)
=>
vm
.
$on
(
'
create
'
,
resolve
));
vm
.
createFile
(
textTarget
,
textFile
);
...
...
spec/frontend/ide/components/panes/collapsible_sidebar_spec.js
View file @
e94556e9
...
...
@@ -15,7 +15,7 @@ describe('ide/components/panes/collapsible_sidebar.vue', () => {
const
width
=
350
;
const
fakeComponentName
=
'
fake-component
'
;
const
createComponent
=
props
=>
{
const
createComponent
=
(
props
)
=>
{
wrapper
=
shallowMount
(
CollapsibleSidebar
,
{
localVue
,
store
,
...
...
spec/frontend/ide/components/panes/right_spec.js
View file @
e94556e9
...
...
@@ -14,7 +14,7 @@ describe('ide/components/panes/right.vue', () => {
let
wrapper
;
let
store
;
const
createComponent
=
props
=>
{
const
createComponent
=
(
props
)
=>
{
extendStore
(
store
,
document
.
createElement
(
'
div
'
));
wrapper
=
shallowMount
(
RightPane
,
{
...
...
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