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
482d756c
Commit
482d756c
authored
Dec 22, 2020
by
Lukas Eipert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Run prettier on 35 spec files: 9 of 10
Mandatory not to break master. Automatically created with prettier.
parent
4700ac1d
Changes
36
Hide whitespace changes
Inline
Side-by-side
Showing
36 changed files
with
104 additions
and
266 deletions
+104
-266
.prettierignore
.prettierignore
+0
-16
spec/frontend/profile/account/components/delete_account_modal_spec.js
...d/profile/account/components/delete_account_modal_spec.js
+2
-6
spec/frontend/projects/commits/components/author_select_spec.js
...rontend/projects/commits/components/author_select_spec.js
+5
-21
spec/frontend/projects/pipelines/charts/mock_data.js
spec/frontend/projects/pipelines/charts/mock_data.js
+14
-2
spec/frontend/projects/project_new_spec.js
spec/frontend/projects/project_new_spec.js
+1
-4
spec/frontend/prometheus_metrics/prometheus_metrics_spec.js
spec/frontend/prometheus_metrics/prometheus_metrics_spec.js
+1
-6
spec/frontend/ref/components/ref_selector_spec.js
spec/frontend/ref/components/ref_selector_spec.js
+3
-9
spec/frontend/registry/explorer/components/details_page/tags_list_row_spec.js
...ry/explorer/components/details_page/tags_list_row_spec.js
+1
-5
spec/frontend/registry/explorer/components/details_page/tags_list_spec.js
...gistry/explorer/components/details_page/tags_list_spec.js
+5
-17
spec/frontend/registry/explorer/components/details_page/tags_loader_spec.js
...stry/explorer/components/details_page/tags_loader_spec.js
+1
-5
spec/frontend/registry/explorer/components/list_page/image_list_spec.js
...registry/explorer/components/list_page/image_list_spec.js
+1
-3
spec/frontend/registry/explorer/components/registry_breadcrumb_spec.js
.../registry/explorer/components/registry_breadcrumb_spec.js
+1
-5
spec/frontend/registry/settings/components/expiration_dropdown_spec.js
.../registry/settings/components/expiration_dropdown_spec.js
+4
-1
spec/frontend/registry/settings/utils_spec.js
spec/frontend/registry/settings/utils_spec.js
+4
-1
spec/frontend/related_merge_requests/components/related_merge_requests_spec.js
..._merge_requests/components/related_merge_requests_spec.js
+1
-4
spec/frontend/releases/components/release_block_milestone_info_spec.js
.../releases/components/release_block_milestone_info_spec.js
+2
-6
spec/frontend/reports/codequality_report/grouped_codequality_reports_app_spec.js
...odequality_report/grouped_codequality_reports_app_spec.js
+2
-10
spec/frontend/reports/components/grouped_test_reports_app_spec.js
...ntend/reports/components/grouped_test_reports_app_spec.js
+3
-5
spec/frontend/repository/components/breadcrumbs_spec.js
spec/frontend/repository/components/breadcrumbs_spec.js
+4
-12
spec/frontend/repository/components/directory_download_links_spec.js
...nd/repository/components/directory_download_links_spec.js
+4
-1
spec/frontend/self_monitor/components/self_monitor_form_spec.js
...rontend/self_monitor/components/self_monitor_form_spec.js
+1
-4
spec/frontend/serverless/mock_data.js
spec/frontend/serverless/mock_data.js
+4
-1
spec/frontend/sidebar/components/assignees/collapsed_assignee_spec.js
...d/sidebar/components/assignees/collapsed_assignee_spec.js
+1
-6
spec/frontend/sidebar/components/severity/sidebar_severity_spec.js
...tend/sidebar/components/severity/sidebar_severity_spec.js
+5
-15
spec/frontend/sidebar/sidebar_move_issue_spec.js
spec/frontend/sidebar/sidebar_move_issue_spec.js
+2
-8
spec/frontend/sidebar/todo_spec.js
spec/frontend/sidebar/todo_spec.js
+1
-6
spec/frontend/snippets/components/snippet_blob_actions_edit_spec.js
...end/snippets/components/snippet_blob_actions_edit_spec.js
+3
-13
spec/frontend/vue_mr_widget/components/approvals/approvals_spec.js
...tend/vue_mr_widget/components/approvals/approvals_spec.js
+1
-4
spec/frontend/vue_mr_widget/components/artifacts_list_spec.js
.../frontend/vue_mr_widget/components/artifacts_list_spec.js
+2
-12
spec/frontend/vue_mr_widget/components/mr_collapsible_extension_spec.js
...vue_mr_widget/components/mr_collapsible_extension_spec.js
+2
-12
spec/frontend/vue_mr_widget/components/mr_widget_pipeline_spec.js
...ntend/vue_mr_widget/components/mr_widget_pipeline_spec.js
+3
-15
spec/frontend/vue_mr_widget/components/states/mr_widget_closed_spec.js
.../vue_mr_widget/components/states/mr_widget_closed_spec.js
+2
-8
spec/frontend/vue_mr_widget/components/states/mr_widget_conflicts_spec.js
...e_mr_widget/components/states/mr_widget_conflicts_spec.js
+3
-6
spec/frontend/vue_mr_widget/components/states/mr_widget_ready_to_merge_spec.js
...widget/components/states/mr_widget_ready_to_merge_spec.js
+9
-6
spec/frontend/vue_mr_widget/mock_data.js
spec/frontend/vue_mr_widget/mock_data.js
+4
-1
spec/frontend/vue_mr_widget/mr_widget_how_to_merge_modal_spec.js
...ontend/vue_mr_widget/mr_widget_how_to_merge_modal_spec.js
+2
-10
No files found.
.prettierignore
View file @
482d756c
...
...
@@ -11,22 +11,6 @@ doc/api/graphql/reference/gitlab_schema.graphql
*.md
# temporarly ignored in order to migrate to prettier@2 more efficiently and iteratively:
spec/frontend/profile/account/components
spec/frontend/projects
spec/frontend/prometheus_metrics
spec/frontend/ref/components
spec/frontend/registry/explorer/components
spec/frontend/registry/settings
spec/frontend/related_merge_requests/components
spec/frontend/releases/components
spec/frontend/reports/codequality_report
spec/frontend/reports/components
spec/frontend/repository/components
spec/frontend/self_monitor/components
spec/frontend/serverless
spec/frontend/sidebar
spec/frontend/snippets/components
spec/frontend/vue_mr_widget
spec/frontend/vue_shared/components
spec/frontend/vue_shared/directives
spec/frontend_integration/ide/helpers
...
...
spec/frontend/profile/account/components/delete_account_modal_spec.js
View file @
482d756c
...
...
@@ -65,9 +65,7 @@ describe('DeleteAccountModal component', () => {
vm
.
isOpen
=
true
;
Vue
.
nextTick
()
.
then
(
done
)
.
catch
(
done
.
fail
);
Vue
.
nextTick
().
then
(
done
).
catch
(
done
.
fail
);
});
it
(
'
does not accept empty password
'
,
done
=>
{
...
...
@@ -117,9 +115,7 @@ describe('DeleteAccountModal component', () => {
vm
.
isOpen
=
true
;
Vue
.
nextTick
()
.
then
(
done
)
.
catch
(
done
.
fail
);
Vue
.
nextTick
().
then
(
done
).
catch
(
done
.
fail
);
});
it
(
'
does not accept wrong username
'
,
done
=>
{
...
...
spec/frontend/projects/commits/components/author_select_spec.js
View file @
482d756c
...
...
@@ -139,11 +139,7 @@ describe('Author Select', () => {
});
it
(
'
has a "Any Author" as the first list item
'
,
()
=>
{
expect
(
findDropdownItems
()
.
at
(
0
)
.
text
(),
).
toBe
(
'
Any Author
'
);
expect
(
findDropdownItems
().
at
(
0
).
text
()).
toBe
(
'
Any Author
'
);
});
it
(
'
displays the project authors
'
,
()
=>
{
...
...
@@ -163,21 +159,13 @@ describe('Author Select', () => {
wrapper
.
setData
({
currentAuthor
});
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
expect
(
findDropdownItems
()
.
at
(
1
)
.
props
(),
).
toEqual
(
expect
.
objectContaining
(
result
));
expect
(
findDropdownItems
().
at
(
1
).
props
()).
toEqual
(
expect
.
objectContaining
(
result
));
});
});
it
(
"
display the author's name
"
,
()
=>
{
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
expect
(
findDropdownItems
()
.
at
(
1
)
.
text
(),
).
toBe
(
currentAuthor
);
expect
(
findDropdownItems
().
at
(
1
).
text
()).
toBe
(
currentAuthor
);
});
});
...
...
@@ -186,9 +174,7 @@ describe('Author Select', () => {
const
spy
=
jest
.
spyOn
(
urlUtility
,
'
redirectTo
'
);
spy
.
mockImplementation
(()
=>
'
mock
'
);
findDropdownItems
()
.
at
(
1
)
.
vm
.
$emit
(
'
click
'
);
findDropdownItems
().
at
(
1
).
vm
.
$emit
(
'
click
'
);
expect
(
spy
).
toHaveBeenCalledWith
(
redirectToUrl
);
});
...
...
@@ -198,9 +184,7 @@ describe('Author Select', () => {
const
spy
=
jest
.
spyOn
(
urlUtility
,
'
redirectTo
'
);
spy
.
mockImplementation
();
findDropdownItems
()
.
at
(
0
)
.
vm
.
$emit
(
'
click
'
);
findDropdownItems
().
at
(
0
).
vm
.
$emit
(
'
click
'
);
expect
(
spy
).
toHaveBeenCalledWith
(
redirectToUrl
);
});
});
...
...
spec/frontend/projects/pipelines/charts/mock_data.js
View file @
482d756c
...
...
@@ -25,11 +25,23 @@ export const lastYearChartData = {
export
const
transformedAreaChartData
=
[
{
name
:
'
all
'
,
data
:
[[
'
01 Jan
'
,
4
],
[
'
02 Jan
'
,
6
],
[
'
03 Jan
'
,
3
],
[
'
04 Jan
'
,
6
],
[
'
05 Jan
'
,
7
]],
data
:
[
[
'
01 Jan
'
,
4
],
[
'
02 Jan
'
,
6
],
[
'
03 Jan
'
,
3
],
[
'
04 Jan
'
,
6
],
[
'
05 Jan
'
,
7
],
],
},
{
name
:
'
success
'
,
data
:
[[
'
01 Jan
'
,
3
],
[
'
02 Jan
'
,
3
],
[
'
03 Jan
'
,
3
],
[
'
04 Jan
'
,
3
],
[
'
05 Jan
'
,
5
]],
data
:
[
[
'
01 Jan
'
,
3
],
[
'
02 Jan
'
,
3
],
[
'
03 Jan
'
,
3
],
[
'
04 Jan
'
,
3
],
[
'
05 Jan
'
,
5
],
],
},
];
...
...
spec/frontend/projects/project_new_spec.js
View file @
482d756c
...
...
@@ -38,10 +38,7 @@ describe('New Project', () => {
beforeEach
(()
=>
{
projectNew
.
bindEvents
();
$projectPath
.
val
(
''
)
.
keyup
()
.
val
(
dummyImportUrl
);
$projectPath
.
val
(
''
).
keyup
().
val
(
dummyImportUrl
);
});
it
(
'
does not change project path for disabled $projectImportUrl
'
,
()
=>
{
...
...
spec/frontend/prometheus_metrics/prometheus_metrics_spec.js
View file @
482d756c
...
...
@@ -91,12 +91,7 @@ describe('PrometheusMetrics', () => {
);
expect
(
$metricsListLi
.
length
).
toEqual
(
metrics
.
length
);
expect
(
$metricsListLi
.
first
()
.
find
(
'
.badge
'
)
.
text
(),
).
toEqual
(
`
${
metrics
[
0
].
active_metrics
}
`
);
expect
(
$metricsListLi
.
first
().
find
(
'
.badge
'
).
text
()).
toEqual
(
`
${
metrics
[
0
].
active_metrics
}
`
);
});
it
(
'
should show missing environment variables list
'
,
()
=>
{
...
...
spec/frontend/ref/components/ref_selector_spec.js
View file @
482d756c
...
...
@@ -313,9 +313,7 @@ describe('Ref selector component', () => {
it
(
'
renders the "Branches" heading with a total number indicator
'
,
()
=>
{
expect
(
findBranchesSection
()
.
find
(
'
[data-testid="section-header"]
'
)
.
text
(),
findBranchesSection
().
find
(
'
[data-testid="section-header"]
'
).
text
(),
).
toMatchInterpolatedText
(
'
Branches 123
'
);
});
...
...
@@ -392,9 +390,7 @@ describe('Ref selector component', () => {
it
(
'
renders the "Tags" heading with a total number indicator
'
,
()
=>
{
expect
(
findTagsSection
()
.
find
(
'
[data-testid="section-header"]
'
)
.
text
(),
findTagsSection
().
find
(
'
[data-testid="section-header"]
'
).
text
(),
).
toMatchInterpolatedText
(
'
Tags 456
'
);
});
...
...
@@ -460,9 +456,7 @@ describe('Ref selector component', () => {
it
(
'
renders the "Commits" heading with a total number indicator
'
,
()
=>
{
expect
(
findCommitsSection
()
.
find
(
'
[data-testid="section-header"]
'
)
.
text
(),
findCommitsSection
().
find
(
'
[data-testid="section-header"]
'
).
text
(),
).
toMatchInterpolatedText
(
'
Commits 1
'
);
});
...
...
spec/frontend/registry/explorer/components/details_page/tags_list_row_spec.js
View file @
482d756c
...
...
@@ -306,11 +306,7 @@ describe('tags list row', () => {
});
it
(
`is
${
clipboard
}
that clipboard button exist`
,
()
=>
{
expect
(
finderFunction
()
.
find
(
ClipboardButton
)
.
exists
(),
).
toBe
(
clipboard
);
expect
(
finderFunction
().
find
(
ClipboardButton
).
exists
()).
toBe
(
clipboard
);
});
});
});
...
...
spec/frontend/registry/explorer/components/details_page/tags_list_spec.js
View file @
482d756c
...
...
@@ -78,18 +78,14 @@ describe('Tags List', () => {
it
(
'
is enabled when at least one item is selected
'
,
async
()
=>
{
mountComponent
();
findTagsListRow
()
.
at
(
0
)
.
vm
.
$emit
(
'
select
'
);
findTagsListRow
().
at
(
0
).
vm
.
$emit
(
'
select
'
);
await
wrapper
.
vm
.
$nextTick
();
expect
(
findDeleteButton
().
attributes
(
'
disabled
'
)).
toBe
(
undefined
);
});
it
(
'
click event emits a deleted event with selected items
'
,
()
=>
{
mountComponent
();
findTagsListRow
()
.
at
(
0
)
.
vm
.
$emit
(
'
select
'
);
findTagsListRow
().
at
(
0
).
vm
.
$emit
(
'
select
'
);
findDeleteButton
().
vm
.
$emit
(
'
click
'
);
expect
(
wrapper
.
emitted
(
'
delete
'
)).
toEqual
([[{
'
beta-24753
'
:
true
}]]);
...
...
@@ -116,22 +112,14 @@ describe('Tags List', () => {
describe
(
'
events
'
,
()
=>
{
it
(
'
select event update the selected items
'
,
async
()
=>
{
mountComponent
();
findTagsListRow
()
.
at
(
0
)
.
vm
.
$emit
(
'
select
'
);
findTagsListRow
().
at
(
0
).
vm
.
$emit
(
'
select
'
);
await
wrapper
.
vm
.
$nextTick
();
expect
(
findTagsListRow
()
.
at
(
0
)
.
attributes
(
'
selected
'
),
).
toBe
(
'
true
'
);
expect
(
findTagsListRow
().
at
(
0
).
attributes
(
'
selected
'
)).
toBe
(
'
true
'
);
});
it
(
'
delete event emit a delete event
'
,
()
=>
{
mountComponent
();
findTagsListRow
()
.
at
(
0
)
.
vm
.
$emit
(
'
delete
'
);
findTagsListRow
().
at
(
0
).
vm
.
$emit
(
'
delete
'
);
expect
(
wrapper
.
emitted
(
'
delete
'
)).
toEqual
([[{
'
beta-24753
'
:
true
}]]);
});
});
...
...
spec/frontend/registry/explorer/components/details_page/tags_loader_spec.js
View file @
482d756c
...
...
@@ -32,11 +32,7 @@ describe('TagsLoader component', () => {
it
(
'
has the correct props
'
,
()
=>
{
mountComponent
();
expect
(
findGlSkeletonLoaders
()
.
at
(
0
)
.
props
(),
).
toMatchObject
({
expect
(
findGlSkeletonLoaders
().
at
(
0
).
props
()).
toMatchObject
({
width
:
component
.
loader
.
width
,
height
:
component
.
loader
.
height
,
});
...
...
spec/frontend/registry/explorer/components/list_page/image_list_spec.js
View file @
482d756c
...
...
@@ -35,9 +35,7 @@ describe('Image List', () => {
it
(
'
when delete event is emitted on the row it emits up a delete event
'
,
()
=>
{
mountComponent
();
findRow
()
.
at
(
0
)
.
vm
.
$emit
(
'
delete
'
,
'
foo
'
);
findRow
().
at
(
0
).
vm
.
$emit
(
'
delete
'
,
'
foo
'
);
expect
(
wrapper
.
emitted
(
'
delete
'
)).
toEqual
([[
'
foo
'
]]);
});
});
...
...
spec/frontend/registry/explorer/components/registry_breadcrumb_spec.js
View file @
482d756c
...
...
@@ -119,11 +119,7 @@ describe('Registry Breadcrumb', () => {
});
it
(
'
has the same classes as the last children of the crumbs
'
,
()
=>
{
expect
(
findLastCrumb
()
.
classes
()
.
join
(
'
'
),
).
toEqual
(
lastChildren
.
className
);
expect
(
findLastCrumb
().
classes
().
join
(
'
'
)).
toEqual
(
lastChildren
.
className
);
});
it
(
'
has a link to the current route
'
,
()
=>
{
...
...
spec/frontend/registry/settings/components/expiration_dropdown_spec.js
View file @
482d756c
...
...
@@ -8,7 +8,10 @@ describe('ExpirationDropdown', () => {
const
defaultProps
=
{
name
:
'
foo
'
,
label
:
'
label-bar
'
,
formOptions
:
[{
key
:
'
foo
'
,
label
:
'
bar
'
},
{
key
:
'
baz
'
,
label
:
'
zab
'
}],
formOptions
:
[
{
key
:
'
foo
'
,
label
:
'
bar
'
},
{
key
:
'
baz
'
,
label
:
'
zab
'
},
],
};
const
findFormSelect
=
()
=>
wrapper
.
find
(
GlFormSelect
);
...
...
spec/frontend/registry/settings/utils_spec.js
View file @
482d756c
...
...
@@ -11,7 +11,10 @@ describe('Utils', () => {
[{
variable
:
1
},
{
variable
:
2
}],
olderThanTranslationGenerator
,
);
expect
(
result
).
toEqual
([{
variable
:
1
,
label
:
'
1 day
'
},
{
variable
:
2
,
label
:
'
2 days
'
}]);
expect
(
result
).
toEqual
([
{
variable
:
1
,
label
:
'
1 day
'
},
{
variable
:
2
,
label
:
'
2 days
'
},
]);
});
});
...
...
spec/frontend/related_merge_requests/components/related_merge_requests_spec.js
View file @
482d756c
...
...
@@ -73,10 +73,7 @@ describe('RelatedMergeRequests', () => {
expect
(
wrapper
.
find
(
'
.js-items-count
'
).
text
()).
toEqual
(
'
2
'
);
expect
(
wrapper
.
findAll
(
RelatedIssuableItem
).
length
).
toEqual
(
2
);
const
props
=
wrapper
.
findAll
(
RelatedIssuableItem
)
.
at
(
1
)
.
props
();
const
props
=
wrapper
.
findAll
(
RelatedIssuableItem
).
at
(
1
).
props
();
const
data
=
mockData
[
1
];
expect
(
props
.
idKey
).
toEqual
(
data
.
id
);
...
...
spec/frontend/releases/components/release_block_milestone_info_spec.js
View file @
482d756c
...
...
@@ -67,9 +67,7 @@ describe('Release block milestone info', () => {
).
toBe
(
true
);
milestones
.
forEach
((
m
,
i
)
=>
{
const
milestoneLink
=
milestoneListContainer
()
.
findAll
(
GlLink
)
.
at
(
i
);
const
milestoneLink
=
milestoneListContainer
().
findAll
(
GlLink
).
at
(
i
);
expect
(
milestoneLink
.
text
()).
toBe
(
m
.
title
);
expect
(
milestoneLink
.
attributes
(
'
href
'
)).
toBe
(
m
.
webUrl
);
...
...
@@ -118,9 +116,7 @@ describe('Release block milestone info', () => {
});
const
clickShowMoreFewerButton
=
()
=>
{
milestoneListContainer
()
.
find
(
GlButton
)
.
trigger
(
'
click
'
);
milestoneListContainer
().
find
(
GlButton
).
trigger
(
'
click
'
);
return
wrapper
.
vm
.
$nextTick
();
};
...
...
spec/frontend/reports/codequality_report/grouped_codequality_reports_app_spec.js
View file @
482d756c
...
...
@@ -139,11 +139,7 @@ describe('Grouped code quality reports app', () => {
});
it
(
'
renders a help icon with more information
'
,
()
=>
{
expect
(
findWidget
()
.
find
(
'
[data-testid="question-icon"]
'
)
.
exists
(),
).
toBe
(
true
);
expect
(
findWidget
().
find
(
'
[data-testid="question-icon"]
'
).
exists
()).
toBe
(
true
);
});
});
...
...
@@ -157,11 +153,7 @@ describe('Grouped code quality reports app', () => {
});
it
(
'
does not render a help icon
'
,
()
=>
{
expect
(
findWidget
()
.
find
(
'
[data-testid="question-icon"]
'
)
.
exists
(),
).
toBe
(
false
);
expect
(
findWidget
().
find
(
'
[data-testid="question-icon"]
'
).
exists
()).
toBe
(
false
);
});
});
});
spec/frontend/reports/components/grouped_test_reports_app_spec.js
View file @
482d756c
...
...
@@ -232,11 +232,9 @@ describe('Grouped test reports app', () => {
});
it
(
'
renders resolved errors
'
,
()
=>
{
expect
(
findAllIssueDescriptions
()
.
at
(
2
)
.
text
(),
).
toContain
(
resolvedFailures
.
suites
[
0
].
resolved_errors
[
0
].
name
);
expect
(
findAllIssueDescriptions
().
at
(
2
).
text
()).
toContain
(
resolvedFailures
.
suites
[
0
].
resolved_errors
[
0
].
name
,
);
});
});
...
...
spec/frontend/repository/components/breadcrumbs_spec.js
View file @
482d756c
...
...
@@ -36,23 +36,15 @@ describe('Repository breadcrumbs component', () => {
it
(
'
escapes hash in directory path
'
,
()
=>
{
factory
(
'
app/assets/javascripts#
'
);
expect
(
vm
.
findAll
(
RouterLinkStub
)
.
at
(
3
)
.
props
(
'
to
'
),
).
toEqual
(
'
/-/tree/app/assets/javascripts%23
'
);
expect
(
vm
.
findAll
(
RouterLinkStub
).
at
(
3
).
props
(
'
to
'
)).
toEqual
(
'
/-/tree/app/assets/javascripts%23
'
,
);
});
it
(
'
renders last link as active
'
,
()
=>
{
factory
(
'
app/assets
'
);
expect
(
vm
.
findAll
(
RouterLinkStub
)
.
at
(
2
)
.
attributes
(
'
aria-current
'
),
).
toEqual
(
'
page
'
);
expect
(
vm
.
findAll
(
RouterLinkStub
).
at
(
2
).
attributes
(
'
aria-current
'
)).
toEqual
(
'
page
'
);
});
it
(
'
does not render add to tree dropdown when permissions are false
'
,
()
=>
{
...
...
spec/frontend/repository/components/directory_download_links_spec.js
View file @
482d756c
...
...
@@ -7,7 +7,10 @@ function factory(currentPath) {
vm
=
shallowMount
(
DirectoryDownloadLinks
,
{
propsData
:
{
currentPath
,
links
:
[{
text
:
'
zip
'
,
path
:
'
http://test.com/
'
},
{
text
:
'
tar
'
,
path
:
'
http://test.com/
'
}],
links
:
[
{
text
:
'
zip
'
,
path
:
'
http://test.com/
'
},
{
text
:
'
tar
'
,
path
:
'
http://test.com/
'
},
],
},
});
}
...
...
spec/frontend/self_monitor/components/self_monitor_form_spec.js
View file @
482d756c
...
...
@@ -79,10 +79,7 @@ describe('self monitor component', () => {
wrapper
=
shallowMount
(
SelfMonitor
,
{
store
});
expect
(
wrapper
.
find
({
ref
:
'
selfMonitoringFormText
'
})
.
find
(
'
a
'
)
.
attributes
(
'
href
'
),
wrapper
.
find
({
ref
:
'
selfMonitoringFormText
'
}).
find
(
'
a
'
).
attributes
(
'
href
'
),
).
toEqual
(
`
${
TEST_HOST
}
/instance-administrators-random/gitlab-self-monitoring`
);
});
});
...
...
spec/frontend/serverless/mock_data.js
View file @
482d756c
...
...
@@ -102,7 +102,10 @@ export const mockMetrics = {
result
:
[
{
metric
:
{},
values
:
[[
1551352298.756
,
'
0
'
],
[
1551352358.756
,
'
0
'
]],
values
:
[
[
1551352298.756
,
'
0
'
],
[
1551352358.756
,
'
0
'
],
],
},
],
},
...
...
spec/frontend/sidebar/components/assignees/collapsed_assignee_spec.js
View file @
482d756c
...
...
@@ -28,12 +28,7 @@ describe('CollapsedAssignee assignee component', () => {
it
(
'
has author name
'
,
()
=>
{
createComponent
();
expect
(
wrapper
.
find
(
'
.author
'
)
.
text
()
.
trim
(),
).
toEqual
(
TEST_USER
.
name
);
expect
(
wrapper
.
find
(
'
.author
'
).
text
().
trim
()).
toEqual
(
TEST_USER
.
name
);
});
it
(
'
has assignee avatar
'
,
()
=>
{
...
...
spec/frontend/sidebar/components/severity/sidebar_severity_spec.js
View file @
482d756c
...
...
@@ -119,21 +119,11 @@ describe('SidebarSeverity', () => {
});
it
(
'
should display only icon with a tooltip
'
,
()
=>
{
expect
(
findSeverityToken
()
.
at
(
0
)
.
attributes
(
'
icononly
'
),
).
toBe
(
'
true
'
);
expect
(
findSeverityToken
()
.
at
(
0
)
.
attributes
(
'
iconsize
'
),
).
toBe
(
'
14
'
);
expect
(
findTooltip
()
.
text
()
.
replace
(
/
\s
+/g
,
'
'
),
).
toContain
(
`Severity:
${
INCIDENT_SEVERITY
[
severity
].
label
}
`
);
expect
(
findSeverityToken
().
at
(
0
).
attributes
(
'
icononly
'
)).
toBe
(
'
true
'
);
expect
(
findSeverityToken
().
at
(
0
).
attributes
(
'
iconsize
'
)).
toBe
(
'
14
'
);
expect
(
findTooltip
().
text
().
replace
(
/
\s
+/g
,
'
'
)).
toContain
(
`Severity:
${
INCIDENT_SEVERITY
[
severity
].
label
}
`
,
);
});
it
(
'
should expand the dropdown on collapsed icon click
'
,
async
()
=>
{
...
...
spec/frontend/sidebar/sidebar_move_issue_spec.js
View file @
482d756c
...
...
@@ -133,10 +133,7 @@ describe('SidebarMoveIssue', () => {
// Wait for the autocomplete request to finish
setImmediate
(()
=>
{
test
.
$content
.
find
(
'
.js-move-issue-dropdown-item
'
)
.
eq
(
0
)
.
trigger
(
'
click
'
);
test
.
$content
.
find
(
'
.js-move-issue-dropdown-item
'
).
eq
(
0
).
trigger
(
'
click
'
);
expect
(
test
.
mediator
.
setMoveToProjectId
).
toHaveBeenCalledWith
(
0
);
expect
(
test
.
$confirmButton
.
prop
(
'
disabled
'
)).
toBeTruthy
();
...
...
@@ -152,10 +149,7 @@ describe('SidebarMoveIssue', () => {
// Wait for the autocomplete request to finish
setImmediate
(()
=>
{
test
.
$content
.
find
(
'
.js-move-issue-dropdown-item
'
)
.
eq
(
1
)
.
trigger
(
'
click
'
);
test
.
$content
.
find
(
'
.js-move-issue-dropdown-item
'
).
eq
(
1
).
trigger
(
'
click
'
);
expect
(
test
.
mediator
.
setMoveToProjectId
).
toHaveBeenCalledWith
(
20
);
expect
(
test
.
$confirmButton
.
attr
(
'
disabled
'
)).
toBe
(
undefined
);
...
...
spec/frontend/sidebar/todo_spec.js
View file @
482d756c
...
...
@@ -42,12 +42,7 @@ describe('SidebarTodo', () => {
({
isTodo
,
iconClass
,
label
,
icon
})
=>
{
createComponent
({
isTodo
});
expect
(
wrapper
.
find
(
GlIcon
)
.
classes
()
.
join
(
'
'
),
).
toStrictEqual
(
iconClass
);
expect
(
wrapper
.
find
(
GlIcon
).
classes
().
join
(
'
'
)).
toStrictEqual
(
iconClass
);
expect
(
wrapper
.
find
(
GlIcon
).
props
(
'
name
'
)).
toStrictEqual
(
icon
);
expect
(
wrapper
.
find
(
'
button
'
).
text
()).
toBe
(
label
);
},
...
...
spec/frontend/snippets/components/snippet_blob_actions_edit_spec.js
View file @
482d756c
...
...
@@ -50,14 +50,8 @@ describe('snippets/components/snippet_blob_actions_edit', () => {
},
classes
:
index
>
0
?
[
'
gl-mt-3
'
]
:
[],
}));
const
triggerBlobDelete
=
idx
=>
findBlobEdits
()
.
at
(
idx
)
.
vm
.
$emit
(
'
delete
'
);
const
triggerBlobUpdate
=
(
idx
,
props
)
=>
findBlobEdits
()
.
at
(
idx
)
.
vm
.
$emit
(
'
blob-updated
'
,
props
);
const
triggerBlobDelete
=
idx
=>
findBlobEdits
().
at
(
idx
).
vm
.
$emit
(
'
delete
'
);
const
triggerBlobUpdate
=
(
idx
,
props
)
=>
findBlobEdits
().
at
(
idx
).
vm
.
$emit
(
'
blob-updated
'
,
props
);
afterEach
(()
=>
{
wrapper
.
destroy
();
...
...
@@ -213,11 +207,7 @@ describe('snippets/components/snippet_blob_actions_edit', () => {
it
(
'
disables delete button
'
,
()
=>
{
expect
(
findBlobEdits
()).
toHaveLength
(
1
);
expect
(
findBlobEdits
()
.
at
(
0
)
.
props
(),
).
toMatchObject
({
expect
(
findBlobEdits
().
at
(
0
).
props
()).
toMatchObject
({
showDelete
:
true
,
canDelete
:
false
,
});
...
...
spec/frontend/vue_mr_widget/components/approvals/approvals_spec.js
View file @
482d756c
...
...
@@ -31,10 +31,7 @@ const testApprovalRulesResponse = () => ({ rules: [{ id: 2 }] });
// For some reason, the `Promise.resolve()` needs to be deferred
// or the timing doesn't work.
const
tick
=
()
=>
Promise
.
resolve
();
const
waitForTick
=
done
=>
tick
()
.
then
(
done
)
.
catch
(
done
.
fail
);
const
waitForTick
=
done
=>
tick
().
then
(
done
).
catch
(
done
.
fail
);
describe
(
'
MRWidget approvals
'
,
()
=>
{
let
wrapper
;
...
...
spec/frontend/vue_mr_widget/components/artifacts_list_spec.js
View file @
482d756c
...
...
@@ -39,20 +39,10 @@ describe('Artifacts List', () => {
});
it
(
'
renders job url
'
,
()
=>
{
expect
(
wrapper
.
findAll
(
GlLink
)
.
at
(
1
)
.
attributes
(
'
href
'
),
).
toEqual
(
data
.
artifacts
[
0
].
job_path
);
expect
(
wrapper
.
findAll
(
GlLink
).
at
(
1
).
attributes
(
'
href
'
)).
toEqual
(
data
.
artifacts
[
0
].
job_path
);
});
it
(
'
renders job name
'
,
()
=>
{
expect
(
wrapper
.
findAll
(
GlLink
)
.
at
(
1
)
.
text
(),
).
toEqual
(
data
.
artifacts
[
0
].
job_name
);
expect
(
wrapper
.
findAll
(
GlLink
).
at
(
1
).
text
()).
toEqual
(
data
.
artifacts
[
0
].
job_name
);
});
});
spec/frontend/vue_mr_widget/components/mr_collapsible_extension_spec.js
View file @
482d756c
...
...
@@ -65,18 +65,8 @@ describe('Merge Request Collapsible Extension', () => {
});
it
(
'
renders the buttons disabled
'
,
()
=>
{
expect
(
wrapper
.
findAll
(
'
button
'
)
.
at
(
0
)
.
attributes
(
'
disabled
'
),
).
toEqual
(
'
disabled
'
);
expect
(
wrapper
.
findAll
(
'
button
'
)
.
at
(
1
)
.
attributes
(
'
disabled
'
),
).
toEqual
(
'
disabled
'
);
expect
(
wrapper
.
findAll
(
'
button
'
).
at
(
0
).
attributes
(
'
disabled
'
)).
toEqual
(
'
disabled
'
);
expect
(
wrapper
.
findAll
(
'
button
'
).
at
(
1
).
attributes
(
'
disabled
'
)).
toEqual
(
'
disabled
'
);
});
it
(
'
renders loading spinner
'
,
()
=>
{
...
...
spec/frontend/vue_mr_widget/components/mr_widget_pipeline_spec.js
View file @
482d756c
...
...
@@ -72,21 +72,13 @@ describe('MRWidgetPipeline', () => {
});
it
(
'
should render pipeline ID
'
,
()
=>
{
expect
(
findPipelineID
()
.
text
()
.
trim
(),
).
toBe
(
`#
${
mockData
.
pipeline
.
id
}
`
);
expect
(
findPipelineID
().
text
().
trim
()).
toBe
(
`#
${
mockData
.
pipeline
.
id
}
`
);
});
it
(
'
should render pipeline status and commit id
'
,
()
=>
{
expect
(
findPipelineInfoContainer
().
text
()).
toMatch
(
mockData
.
pipeline
.
details
.
status
.
label
);
expect
(
findCommitLink
()
.
text
()
.
trim
(),
).
toBe
(
mockData
.
pipeline
.
commit
.
short_id
);
expect
(
findCommitLink
().
text
().
trim
()).
toBe
(
mockData
.
pipeline
.
commit
.
short_id
);
expect
(
findCommitLink
().
attributes
(
'
href
'
)).
toBe
(
mockData
.
pipeline
.
commit
.
commit_path
);
});
...
...
@@ -148,11 +140,7 @@ describe('MRWidgetPipeline', () => {
});
it
(
'
should render pipeline ID
'
,
()
=>
{
expect
(
findPipelineID
()
.
text
()
.
trim
(),
).
toBe
(
`#
${
mockData
.
pipeline
.
id
}
`
);
expect
(
findPipelineID
().
text
().
trim
()).
toBe
(
`#
${
mockData
.
pipeline
.
id
}
`
);
});
it
(
'
should render pipeline status
'
,
()
=>
{
...
...
spec/frontend/vue_mr_widget/components/states/mr_widget_closed_spec.js
View file @
482d756c
...
...
@@ -39,10 +39,7 @@ describe('MRWidgetClosed', () => {
it
(
'
renders closed by information with author and time
'
,
()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.js-mr-widget-author
'
)
.
textContent
.
trim
()
.
replace
(
/
\s\s
+/g
,
'
'
),
vm
.
$el
.
querySelector
(
'
.js-mr-widget-author
'
).
textContent
.
trim
().
replace
(
/
\s\s
+/g
,
'
'
),
).
toContain
(
'
Closed by Administrator less than a minute ago
'
);
});
...
...
@@ -54,10 +51,7 @@ describe('MRWidgetClosed', () => {
it
(
'
renders information about the changes not being merged
'
,
()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.mr-info-list
'
)
.
textContent
.
trim
()
.
replace
(
/
\s\s
+/g
,
'
'
),
vm
.
$el
.
querySelector
(
'
.mr-info-list
'
).
textContent
.
trim
().
replace
(
/
\s\s
+/g
,
'
'
),
).
toContain
(
'
The changes were not merged into so_long_jquery
'
);
});
...
...
spec/frontend/vue_mr_widget/components/states/mr_widget_conflicts_spec.js
View file @
482d756c
...
...
@@ -167,12 +167,9 @@ describe('MRWidgetConflicts', () => {
},
});
expect
(
vm
.
text
()
.
trim
()
.
replace
(
/
\s\s
+/g
,
'
'
),
).
toContain
(
'
ask someone with write access
'
);
expect
(
vm
.
text
().
trim
().
replace
(
/
\s\s
+/g
,
'
'
)).
toContain
(
'
ask someone with write access
'
,
);
});
it
(
'
should not have action buttons
'
,
async
()
=>
{
...
...
spec/frontend/vue_mr_widget/components/states/mr_widget_ready_to_merge_spec.js
View file @
482d756c
...
...
@@ -480,7 +480,10 @@ describe('ReadyToMerge', () => {
jest
.
spyOn
(
vm
.
service
,
'
poll
'
).
mockReturnValue
(
returnPromise
(
'
merged
'
));
jest
.
spyOn
(
vm
,
'
initiateRemoveSourceBranchPolling
'
).
mockImplementation
(()
=>
{});
vm
.
handleMergePolling
(()
=>
{},
()
=>
{});
vm
.
handleMergePolling
(
()
=>
{},
()
=>
{},
);
setImmediate
(()
=>
{
const
statusBox
=
document
.
querySelector
(
'
.status-box
'
);
...
...
@@ -496,7 +499,10 @@ describe('ReadyToMerge', () => {
jest
.
spyOn
(
vm
.
service
,
'
poll
'
).
mockReturnValue
(
returnPromise
(
'
merged
'
));
jest
.
spyOn
(
vm
,
'
initiateRemoveSourceBranchPolling
'
).
mockImplementation
(()
=>
{});
vm
.
handleMergePolling
(()
=>
{},
()
=>
{});
vm
.
handleMergePolling
(
()
=>
{},
()
=>
{},
);
setImmediate
(()
=>
{
expect
(
document
.
querySelector
(
'
.js-merge-counter
'
).
textContent
).
toBe
(
'
0
'
);
...
...
@@ -657,10 +663,7 @@ describe('ReadyToMerge', () => {
const
findCommitsHeaderElement
=
()
=>
wrapper
.
find
(
CommitsHeader
);
const
findCommitEditElements
=
()
=>
wrapper
.
findAll
(
CommitEdit
);
const
findCommitDropdownElement
=
()
=>
wrapper
.
find
(
CommitMessageDropdown
);
const
findFirstCommitEditLabel
=
()
=>
findCommitEditElements
()
.
at
(
0
)
.
props
(
'
label
'
);
const
findFirstCommitEditLabel
=
()
=>
findCommitEditElements
().
at
(
0
).
props
(
'
label
'
);
describe
(
'
squash checkbox
'
,
()
=>
{
it
(
'
should be rendered when squash before merge is enabled and there is more than 1 commit
'
,
()
=>
{
...
...
spec/frontend/vue_mr_widget/mock_data.js
View file @
482d756c
...
...
@@ -194,7 +194,10 @@ export default {
updated_at
:
'
2017-04-07T15:28:44.800Z
'
,
},
pipelineCoverageDelta
:
'
15.25
'
,
buildsWithCoverage
:
[{
name
:
'
karma
'
,
coverage
:
'
40.2
'
},
{
name
:
'
rspec
'
,
coverage
:
'
80.4
'
}],
buildsWithCoverage
:
[
{
name
:
'
karma
'
,
coverage
:
'
40.2
'
},
{
name
:
'
rspec
'
,
coverage
:
'
80.4
'
},
],
work_in_progress
:
false
,
source_branch_exists
:
false
,
mergeable_discussions_state
:
true
,
...
...
spec/frontend/vue_mr_widget/mr_widget_how_to_merge_modal_spec.js
View file @
482d756c
...
...
@@ -50,19 +50,11 @@ describe('MRWidgetHowToMerge', () => {
it
(
'
should render different instructions based on if the user can merge
'
,
()
=>
{
mountComponent
({
props
:
{
canMerge
:
true
}
});
expect
(
findInstructionsFields
()
.
at
(
2
)
.
text
(),
).
toContain
(
'
git push origin
'
);
expect
(
findInstructionsFields
().
at
(
2
).
text
()).
toContain
(
'
git push origin
'
);
});
it
(
'
should render different instructions based on if the merge is based off a fork
'
,
()
=>
{
mountComponent
({
props
:
{
isFork
:
true
}
});
expect
(
findInstructionsFields
()
.
at
(
0
)
.
text
(),
).
toContain
(
'
FETCH_HEAD
'
);
expect
(
findInstructionsFields
().
at
(
0
).
text
()).
toContain
(
'
FETCH_HEAD
'
);
});
});
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