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
39bb37cc
Commit
39bb37cc
authored
Dec 23, 2020
by
Lukas Eipert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Run prettier on 31 files - 51 of 73
Part of our prettier migration; changing the arrow-parens style.
parent
cdc1a4a8
Changes
32
Show whitespace changes
Inline
Side-by-side
Showing
32 changed files
with
115 additions
and
148 deletions
+115
-148
.prettierignore
.prettierignore
+0
-33
ee/spec/frontend/threat_monitoring/components/statistics_summary_spec.js
...d/threat_monitoring/components/statistics_summary_spec.js
+1
-1
ee/spec/frontend/threat_monitoring/components/threat_monitoring_filters_spec.js
...t_monitoring/components/threat_monitoring_filters_spec.js
+1
-1
ee/spec/frontend/threat_monitoring/store/modules/threat_monitoring/actions_spec.js
...onitoring/store/modules/threat_monitoring/actions_spec.js
+1
-1
ee/spec/frontend/threat_monitoring/store/modules/threat_monitoring_statistics/getters_spec.js
...tore/modules/threat_monitoring_statistics/getters_spec.js
+1
-1
ee/spec/frontend/threat_monitoring/store/modules/threat_monitoring_statistics/mutations_spec.js
...re/modules/threat_monitoring_statistics/mutations_spec.js
+1
-1
ee/spec/frontend/trial_registrations/username_suggester_spec.js
...c/frontend/trial_registrations/username_suggester_spec.js
+1
-1
ee/spec/frontend/vue_mr_widget/components/approvals/approvals_auth_spec.js
...vue_mr_widget/components/approvals/approvals_auth_spec.js
+6
-6
ee/spec/frontend/vue_mr_widget/components/approvals/approvals_footer_spec.js
...e_mr_widget/components/approvals/approvals_footer_spec.js
+2
-2
ee/spec/frontend/vue_mr_widget/components/approvals/approvals_list_spec.js
...vue_mr_widget/components/approvals/approvals_list_spec.js
+4
-4
ee/spec/frontend/vue_mr_widget/components/approvals/approvals_spec.js
...tend/vue_mr_widget/components/approvals/approvals_spec.js
+2
-2
ee/spec/frontend/vue_mr_widget/components/blocking_merge_requests/blocking_merge_requests_report_spec.js
...ing_merge_requests/blocking_merge_requests_report_spec.js
+3
-3
ee/spec/frontend/vue_mr_widget/components/merge_train_helper_text_spec.js
.../vue_mr_widget/components/merge_train_helper_text_spec.js
+1
-1
ee/spec/frontend/vue_mr_widget/components/merge_train_position_indicator_spec.js
..._widget/components/merge_train_position_indicator_spec.js
+1
-1
ee/spec/frontend/vue_mr_widget/components/mr_widget_pipeline_container_spec.js
...mr_widget/components/mr_widget_pipeline_container_spec.js
+2
-2
ee/spec/frontend/vue_mr_widget/ee_mr_widget_options_spec.js
ee/spec/frontend/vue_mr_widget/ee_mr_widget_options_spec.js
+33
-33
ee/spec/frontend/vue_mr_widget/stores/mr_widget_store_spec.js
...pec/frontend/vue_mr_widget/stores/mr_widget_store_spec.js
+1
-1
ee/spec/frontend/vue_shared/components/accordion/accordion_item_spec.js
...nd/vue_shared/components/accordion/accordion_item_spec.js
+2
-2
ee/spec/frontend/vue_shared/components/deployment_instance/deployment_instance_spec.js
...omponents/deployment_instance/deployment_instance_spec.js
+3
-3
ee/spec/frontend/vue_shared/components/notes/system_note_spec.js
.../frontend/vue_shared/components/notes/system_note_spec.js
+1
-1
ee/spec/frontend/vue_shared/components/security_reports/severity_badge_spec.js
...shared/components/security_reports/severity_badge_spec.js
+2
-2
ee/spec/frontend/vue_shared/components/sidebar/epics_select/base_spec.js
...d/vue_shared/components/sidebar/epics_select/base_spec.js
+8
-8
ee/spec/frontend/vue_shared/components/sidebar/epics_select/dropdown_contents_spec.js
...components/sidebar/epics_select/dropdown_contents_spec.js
+2
-2
ee/spec/frontend/vue_shared/components/sidebar/epics_select/store/actions_spec.js
...red/components/sidebar/epics_select/store/actions_spec.js
+21
-21
ee/spec/frontend/vue_shared/components/sidebar/epics_select/store/getters_spec.js
...red/components/sidebar/epics_select/store/getters_spec.js
+1
-1
ee/spec/frontend/vue_shared/dashboards/store/actions_spec.js
ee/spec/frontend/vue_shared/dashboards/store/actions_spec.js
+3
-3
ee/spec/frontend/vue_shared/dashboards/store/mutations_spec.js
...ec/frontend/vue_shared/dashboards/store/mutations_spec.js
+3
-3
ee/spec/frontend/vue_shared/discover/card_security_discover_app_spec.js
...nd/vue_shared/discover/card_security_discover_app_spec.js
+1
-1
ee/spec/frontend/vue_shared/license_compliance/components/add_license_form_dropdown_spec.js
...e_compliance/components/add_license_form_dropdown_spec.js
+1
-1
ee/spec/frontend/vue_shared/license_compliance/components/admin_license_management_row_spec.js
...ompliance/components/admin_license_management_row_spec.js
+4
-4
ee/spec/frontend/vue_shared/license_compliance/components/delete_confirmation_modal_spec.js
...e_compliance/components/delete_confirmation_modal_spec.js
+1
-1
ee/spec/frontend/vue_shared/license_compliance/components/license_packages_spec.js
...ed/license_compliance/components/license_packages_spec.js
+1
-1
No files found.
.prettierignore
View file @
39bb37cc
...
@@ -1531,39 +1531,6 @@ ee/spec/frontend/roadmap/components/epic_item_timeline_spec.js
...
@@ -1531,39 +1531,6 @@ ee/spec/frontend/roadmap/components/epic_item_timeline_spec.js
ee/spec/frontend/roadmap/components/epics_list_empty_spec.js
ee/spec/frontend/roadmap/components/epics_list_empty_spec.js
ee/spec/frontend/roadmap/components/milestones_list_section_spec.js
ee/spec/frontend/roadmap/components/milestones_list_section_spec.js
## modest-kilby
ee/spec/frontend/threat_monitoring/components/statistics_summary_spec.js
ee/spec/frontend/threat_monitoring/components/threat_monitoring_filters_spec.js
ee/spec/frontend/threat_monitoring/store/modules/threat_monitoring/actions_spec.js
ee/spec/frontend/threat_monitoring/store/modules/threat_monitoring_statistics/getters_spec.js
ee/spec/frontend/threat_monitoring/store/modules/threat_monitoring_statistics/mutations_spec.js
ee/spec/frontend/trial_registrations/username_suggester_spec.js
ee/spec/frontend/vue_mr_widget/components/approvals/approvals_auth_spec.js
ee/spec/frontend/vue_mr_widget/components/approvals/approvals_footer_spec.js
ee/spec/frontend/vue_mr_widget/components/approvals/approvals_list_spec.js
ee/spec/frontend/vue_mr_widget/components/approvals/approvals_spec.js
ee/spec/frontend/vue_mr_widget/components/blocking_merge_requests/blocking_merge_requests_report_spec.js
ee/spec/frontend/vue_mr_widget/components/merge_train_helper_text_spec.js
ee/spec/frontend/vue_mr_widget/components/merge_train_position_indicator_spec.js
ee/spec/frontend/vue_mr_widget/components/mr_widget_pipeline_container_spec.js
ee/spec/frontend/vue_mr_widget/ee_mr_widget_options_spec.js
ee/spec/frontend/vue_mr_widget/stores/mr_widget_store_spec.js
ee/spec/frontend/vue_shared/components/accordion/accordion_item_spec.js
ee/spec/frontend/vue_shared/components/deployment_instance/deployment_instance_spec.js
ee/spec/frontend/vue_shared/components/notes/system_note_spec.js
ee/spec/frontend/vue_shared/components/security_reports/severity_badge_spec.js
ee/spec/frontend/vue_shared/components/sidebar/epics_select/base_spec.js
ee/spec/frontend/vue_shared/components/sidebar/epics_select/dropdown_contents_spec.js
ee/spec/frontend/vue_shared/components/sidebar/epics_select/store/actions_spec.js
ee/spec/frontend/vue_shared/components/sidebar/epics_select/store/getters_spec.js
ee/spec/frontend/vue_shared/dashboards/store/actions_spec.js
ee/spec/frontend/vue_shared/dashboards/store/mutations_spec.js
ee/spec/frontend/vue_shared/discover/card_security_discover_app_spec.js
ee/spec/frontend/vue_shared/license_compliance/components/add_license_form_dropdown_spec.js
ee/spec/frontend/vue_shared/license_compliance/components/admin_license_management_row_spec.js
ee/spec/frontend/vue_shared/license_compliance/components/delete_confirmation_modal_spec.js
ee/spec/frontend/vue_shared/license_compliance/components/license_packages_spec.js
## interesting-galileo
## interesting-galileo
ee/spec/frontend/vue_shared/license_compliance/license_management_spec.js
ee/spec/frontend/vue_shared/license_compliance/license_management_spec.js
ee/spec/frontend/vue_shared/license_compliance/mock_data.js
ee/spec/frontend/vue_shared/license_compliance/mock_data.js
...
...
ee/spec/frontend/threat_monitoring/components/statistics_summary_spec.js
View file @
39bb37cc
...
@@ -5,7 +5,7 @@ import StatisticsSummary from 'ee/threat_monitoring/components/statistics_summar
...
@@ -5,7 +5,7 @@ import StatisticsSummary from 'ee/threat_monitoring/components/statistics_summar
describe
(
'
StatisticsSummary component
'
,
()
=>
{
describe
(
'
StatisticsSummary component
'
,
()
=>
{
let
wrapper
;
let
wrapper
;
const
factory
=
options
=>
{
const
factory
=
(
options
)
=>
{
wrapper
=
shallowMount
(
StatisticsSummary
,
{
wrapper
=
shallowMount
(
StatisticsSummary
,
{
...
options
,
...
options
,
});
});
...
...
ee/spec/frontend/threat_monitoring/components/threat_monitoring_filters_spec.js
View file @
39bb37cc
...
@@ -12,7 +12,7 @@ describe('ThreatMonitoringFilters component', () => {
...
@@ -12,7 +12,7 @@ describe('ThreatMonitoringFilters component', () => {
let
store
;
let
store
;
let
wrapper
;
let
wrapper
;
const
factory
=
state
=>
{
const
factory
=
(
state
)
=>
{
store
=
createStore
();
store
=
createStore
();
Object
.
assign
(
store
.
state
.
threatMonitoring
,
state
);
Object
.
assign
(
store
.
state
.
threatMonitoring
,
state
);
...
...
ee/spec/frontend/threat_monitoring/store/modules/threat_monitoring/actions_spec.js
View file @
39bb37cc
...
@@ -140,7 +140,7 @@ describe('Threat Monitoring actions', () => {
...
@@ -140,7 +140,7 @@ describe('Threat Monitoring actions', () => {
describe
(
'
given more than one page of environments
'
,
()
=>
{
describe
(
'
given more than one page of environments
'
,
()
=>
{
beforeEach
(()
=>
{
beforeEach
(()
=>
{
const
oneEnvironmentPerPage
=
({
totalPages
})
=>
config
=>
{
const
oneEnvironmentPerPage
=
({
totalPages
})
=>
(
config
)
=>
{
const
{
page
}
=
config
.
params
;
const
{
page
}
=
config
.
params
;
const
response
=
[
httpStatus
.
OK
,
{
environments
:
[{
id
:
page
}]
}];
const
response
=
[
httpStatus
.
OK
,
{
environments
:
[{
id
:
page
}]
}];
if
(
page
<
totalPages
)
{
if
(
page
<
totalPages
)
{
...
...
ee/spec/frontend/threat_monitoring/store/modules/threat_monitoring_statistics/getters_spec.js
View file @
39bb37cc
...
@@ -9,7 +9,7 @@ describe('threatMonitoringStatistics module getters', () => {
...
@@ -9,7 +9,7 @@ describe('threatMonitoringStatistics module getters', () => {
});
});
describe
(
'
hasHistory
'
,
()
=>
{
describe
(
'
hasHistory
'
,
()
=>
{
it
.
each
([
'
nominal
'
,
'
anomalous
'
])(
'
returns true if there is any %s history data
'
,
type
=>
{
it
.
each
([
'
nominal
'
,
'
anomalous
'
])(
'
returns true if there is any %s history data
'
,
(
type
)
=>
{
state
.
statistics
.
history
[
type
]
=
[
'
foo
'
];
state
.
statistics
.
history
[
type
]
=
[
'
foo
'
];
expect
(
getters
.
hasHistory
(
state
)).
toBe
(
true
);
expect
(
getters
.
hasHistory
(
state
)).
toBe
(
true
);
});
});
...
...
ee/spec/frontend/threat_monitoring/store/modules/threat_monitoring_statistics/mutations_spec.js
View file @
39bb37cc
...
@@ -5,7 +5,7 @@ import { mockWafStatisticsResponse } from '../../../mock_data';
...
@@ -5,7 +5,7 @@ import { mockWafStatisticsResponse } from '../../../mock_data';
describe
(
'
threatMonitoringStatistics mutations
'
,
()
=>
{
describe
(
'
threatMonitoringStatistics mutations
'
,
()
=>
{
let
state
;
let
state
;
const
mutations
=
mutationsFactory
(
payload
=>
payload
);
const
mutations
=
mutationsFactory
(
(
payload
)
=>
payload
);
beforeEach
(()
=>
{
beforeEach
(()
=>
{
state
=
{};
state
=
{};
});
});
...
...
ee/spec/frontend/trial_registrations/username_suggester_spec.js
View file @
39bb37cc
...
@@ -134,7 +134,7 @@ describe('UsernameSuggester', () => {
...
@@ -134,7 +134,7 @@ describe('UsernameSuggester', () => {
});
});
});
});
it
(
'
shows a flash message if request fails
'
,
done
=>
{
it
(
'
shows a flash message if request fails
'
,
(
done
)
=>
{
axiosMock
.
onGet
(
usernameEndPoint
).
replyOnce
(
500
);
axiosMock
.
onGet
(
usernameEndPoint
).
replyOnce
(
500
);
expect
(
suggester
.
isLoading
).
toBe
(
false
);
expect
(
suggester
.
isLoading
).
toBe
(
false
);
...
...
ee/spec/frontend/vue_mr_widget/components/approvals/approvals_auth_spec.js
View file @
39bb37cc
...
@@ -6,7 +6,7 @@ const TEST_PASSWORD = 'password';
...
@@ -6,7 +6,7 @@ const TEST_PASSWORD = 'password';
// For some reason, the `Promise.resolve` needs to be deferred
// For some reason, the `Promise.resolve` needs to be deferred
// or the timing doesn't work.
// or the timing doesn't work.
const
waitForTick
=
done
=>
Promise
.
resolve
().
then
(
done
).
catch
(
done
.
fail
);
const
waitForTick
=
(
done
)
=>
Promise
.
resolve
().
then
(
done
).
catch
(
done
.
fail
);
describe
(
'
Approval auth component
'
,
()
=>
{
describe
(
'
Approval auth component
'
,
()
=>
{
let
wrapper
;
let
wrapper
;
...
@@ -29,7 +29,7 @@ describe('Approval auth component', () => {
...
@@ -29,7 +29,7 @@ describe('Approval auth component', () => {
const
findErrorMessage
=
()
=>
wrapper
.
find
(
'
.gl-field-error
'
);
const
findErrorMessage
=
()
=>
wrapper
.
find
(
'
.gl-field-error
'
);
describe
(
'
when created
'
,
()
=>
{
describe
(
'
when created
'
,
()
=>
{
beforeEach
(
done
=>
{
beforeEach
(
(
done
)
=>
{
createComponent
();
createComponent
();
waitForTick
(
done
);
waitForTick
(
done
);
});
});
...
@@ -54,12 +54,12 @@ describe('Approval auth component', () => {
...
@@ -54,12 +54,12 @@ describe('Approval auth component', () => {
});
});
describe
(
'
when approve clicked
'
,
()
=>
{
describe
(
'
when approve clicked
'
,
()
=>
{
beforeEach
(
done
=>
{
beforeEach
(
(
done
)
=>
{
createComponent
();
createComponent
();
waitForTick
(
done
);
waitForTick
(
done
);
});
});
it
(
'
emits the approve event
'
,
done
=>
{
it
(
'
emits the approve event
'
,
(
done
)
=>
{
findInput
().
setValue
(
TEST_PASSWORD
);
findInput
().
setValue
(
TEST_PASSWORD
);
wrapper
.
find
(
GlModal
).
vm
.
$emit
(
'
ok
'
,
{
preventDefault
:
()
=>
null
});
wrapper
.
find
(
GlModal
).
vm
.
$emit
(
'
ok
'
,
{
preventDefault
:
()
=>
null
});
waitForTick
(
done
);
waitForTick
(
done
);
...
@@ -69,7 +69,7 @@ describe('Approval auth component', () => {
...
@@ -69,7 +69,7 @@ describe('Approval auth component', () => {
});
});
describe
(
'
when isApproving is true
'
,
()
=>
{
describe
(
'
when isApproving is true
'
,
()
=>
{
beforeEach
(
done
=>
{
beforeEach
(
(
done
)
=>
{
createComponent
({
isApproving
:
true
});
createComponent
({
isApproving
:
true
});
waitForTick
(
done
);
waitForTick
(
done
);
});
});
...
@@ -82,7 +82,7 @@ describe('Approval auth component', () => {
...
@@ -82,7 +82,7 @@ describe('Approval auth component', () => {
});
});
describe
(
'
when hasError is true
'
,
()
=>
{
describe
(
'
when hasError is true
'
,
()
=>
{
beforeEach
(
done
=>
{
beforeEach
(
(
done
)
=>
{
createComponent
({
hasError
:
true
});
createComponent
({
hasError
:
true
});
waitForTick
(
done
);
waitForTick
(
done
);
});
});
...
...
ee/spec/frontend/vue_mr_widget/components/approvals/approvals_footer_spec.js
View file @
39bb37cc
...
@@ -5,7 +5,7 @@ import ApprovalsList from 'ee/vue_merge_request_widget/components/approvals/appr
...
@@ -5,7 +5,7 @@ import ApprovalsList from 'ee/vue_merge_request_widget/components/approvals/appr
import
stubChildren
from
'
helpers/stub_children
'
;
import
stubChildren
from
'
helpers/stub_children
'
;
import
UserAvatarList
from
'
~/vue_shared/components/user_avatar/user_avatar_list.vue
'
;
import
UserAvatarList
from
'
~/vue_shared/components/user_avatar/user_avatar_list.vue
'
;
const
testSuggestedApprovers
=
()
=>
Array
.
from
({
length
:
11
},
(
_
,
i
)
=>
i
).
map
(
id
=>
({
id
}));
const
testSuggestedApprovers
=
()
=>
Array
.
from
({
length
:
11
},
(
_
,
i
)
=>
i
).
map
(
(
id
)
=>
({
id
}));
const
testApprovalRules
=
()
=>
[{
name
:
'
Lorem
'
},
{
name
:
'
Ipsum
'
}];
const
testApprovalRules
=
()
=>
[{
name
:
'
Lorem
'
},
{
name
:
'
Ipsum
'
}];
describe
(
'
EE MRWidget approvals footer
'
,
()
=>
{
describe
(
'
EE MRWidget approvals footer
'
,
()
=>
{
...
@@ -184,7 +184,7 @@ describe('EE MRWidget approvals footer', () => {
...
@@ -184,7 +184,7 @@ describe('EE MRWidget approvals footer', () => {
expect
(
button
.
text
()).
toBe
(
'
View eligible approvers
'
);
expect
(
button
.
text
()).
toBe
(
'
View eligible approvers
'
);
});
});
it
(
'
expands when clicked
'
,
done
=>
{
it
(
'
expands when clicked
'
,
(
done
)
=>
{
expect
(
wrapper
.
props
(
'
value
'
)).
toBe
(
false
);
expect
(
wrapper
.
props
(
'
value
'
)).
toBe
(
false
);
button
.
vm
.
$emit
(
'
click
'
);
button
.
vm
.
$emit
(
'
click
'
);
...
...
ee/spec/frontend/vue_mr_widget/components/approvals/approvals_list_spec.js
View file @
39bb37cc
...
@@ -3,7 +3,7 @@ import ApprovalsList from 'ee/vue_merge_request_widget/components/approvals/appr
...
@@ -3,7 +3,7 @@ import ApprovalsList from 'ee/vue_merge_request_widget/components/approvals/appr
import
ApprovedIcon
from
'
ee/vue_merge_request_widget/components/approvals/approved_icon.vue
'
;
import
ApprovedIcon
from
'
ee/vue_merge_request_widget/components/approvals/approved_icon.vue
'
;
import
UserAvatarList
from
'
~/vue_shared/components/user_avatar/user_avatar_list.vue
'
;
import
UserAvatarList
from
'
~/vue_shared/components/user_avatar/user_avatar_list.vue
'
;
const
testApprovers
=
()
=>
Array
.
from
({
length
:
11
},
(
_
,
i
)
=>
i
).
map
(
id
=>
({
id
}));
const
testApprovers
=
()
=>
Array
.
from
({
length
:
11
},
(
_
,
i
)
=>
i
).
map
(
(
id
)
=>
({
id
}));
const
testRuleApproved
=
()
=>
({
const
testRuleApproved
=
()
=>
({
id
:
1
,
id
:
1
,
name
:
'
Lorem
'
,
name
:
'
Lorem
'
,
...
@@ -74,7 +74,7 @@ describe('EE MRWidget approvals list', () => {
...
@@ -74,7 +74,7 @@ describe('EE MRWidget approvals list', () => {
const
findRows
=
()
=>
wrapper
.
findAll
(
'
tbody tr
'
);
const
findRows
=
()
=>
wrapper
.
findAll
(
'
tbody tr
'
);
const
findRowElement
=
(
row
,
name
)
=>
row
.
find
(
`.js-
${
name
}
`
);
const
findRowElement
=
(
row
,
name
)
=>
row
.
find
(
`.js-
${
name
}
`
);
const
findRowIcon
=
row
=>
row
.
find
(
ApprovedIcon
);
const
findRowIcon
=
(
row
)
=>
row
.
find
(
ApprovedIcon
);
afterEach
(()
=>
{
afterEach
(()
=>
{
wrapper
.
destroy
();
wrapper
.
destroy
();
...
@@ -91,10 +91,10 @@ describe('EE MRWidget approvals list', () => {
...
@@ -91,10 +91,10 @@ describe('EE MRWidget approvals list', () => {
it
(
'
renders a row for each rule
'
,
()
=>
{
it
(
'
renders a row for each rule
'
,
()
=>
{
const
expected
=
testRules
();
const
expected
=
testRules
();
const
rows
=
findRows
();
const
rows
=
findRows
();
const
names
=
rows
.
wrappers
.
map
(
row
=>
findRowElement
(
row
,
'
name
'
).
text
());
const
names
=
rows
.
wrappers
.
map
(
(
row
)
=>
findRowElement
(
row
,
'
name
'
).
text
());
expect
(
rows
).
toHaveLength
(
expected
.
length
);
expect
(
rows
).
toHaveLength
(
expected
.
length
);
expect
(
names
).
toEqual
(
expected
.
map
(
x
=>
x
.
name
));
expect
(
names
).
toEqual
(
expected
.
map
(
(
x
)
=>
x
.
name
));
});
});
it
(
'
does not render a code owner subtitle
'
,
()
=>
{
it
(
'
does not render a code owner subtitle
'
,
()
=>
{
...
...
ee/spec/frontend/vue_mr_widget/components/approvals/approvals_spec.js
View file @
39bb37cc
...
@@ -19,10 +19,10 @@ import eventHub from '~/vue_merge_request_widget/event_hub';
...
@@ -19,10 +19,10 @@ import eventHub from '~/vue_merge_request_widget/event_hub';
const
TEST_HELP_PATH
=
'
help/path
'
;
const
TEST_HELP_PATH
=
'
help/path
'
;
const
TEST_PASSWORD
=
'
password
'
;
const
TEST_PASSWORD
=
'
password
'
;
const
testApprovedBy
=
()
=>
[
1
,
7
,
10
].
map
(
id
=>
({
id
}));
const
testApprovedBy
=
()
=>
[
1
,
7
,
10
].
map
(
(
id
)
=>
({
id
}));
const
testApprovals
=
()
=>
({
const
testApprovals
=
()
=>
({
approved
:
false
,
approved
:
false
,
approved_by
:
testApprovedBy
().
map
(
user
=>
({
user
})),
approved_by
:
testApprovedBy
().
map
(
(
user
)
=>
({
user
})),
approval_rules_left
:
[],
approval_rules_left
:
[],
approvals_left
:
4
,
approvals_left
:
4
,
suggested_approvers
:
[],
suggested_approvers
:
[],
...
...
ee/spec/frontend/vue_mr_widget/components/blocking_merge_requests/blocking_merge_requests_report_spec.js
View file @
39bb37cc
...
@@ -63,7 +63,7 @@ describe('BlockingMergeRequestsReport', () => {
...
@@ -63,7 +63,7 @@ describe('BlockingMergeRequestsReport', () => {
createComponent
();
createComponent
();
const
reportSectionProps
=
wrapper
.
find
(
ReportSection
).
props
();
const
reportSectionProps
=
wrapper
.
find
(
ReportSection
).
props
();
expect
(
reportSectionProps
.
unresolvedIssues
.
map
(
issue
=>
issue
.
id
)).
toEqual
([
2
,
1
]);
expect
(
reportSectionProps
.
unresolvedIssues
.
map
(
(
issue
)
=>
issue
.
id
)).
toEqual
([
2
,
1
]);
});
});
it
(
'
sets status to "ERROR" when there are unmerged blocking MRs
'
,
()
=>
{
it
(
'
sets status to "ERROR" when there are unmerged blocking MRs
'
,
()
=>
{
...
@@ -112,7 +112,7 @@ describe('BlockingMergeRequestsReport', () => {
...
@@ -112,7 +112,7 @@ describe('BlockingMergeRequestsReport', () => {
it
(
'
does not include merged MRs
'
,
()
=>
{
it
(
'
does not include merged MRs
'
,
()
=>
{
createComponent
();
createComponent
();
const
containsMergedMRs
=
wrapper
.
vm
.
unmergedBlockingMergeRequests
.
some
(
const
containsMergedMRs
=
wrapper
.
vm
.
unmergedBlockingMergeRequests
.
some
(
mr
=>
mr
.
state
===
'
merged
'
,
(
mr
)
=>
mr
.
state
===
'
merged
'
,
);
);
expect
(
containsMergedMRs
).
toBe
(
false
);
expect
(
containsMergedMRs
).
toBe
(
false
);
...
@@ -121,7 +121,7 @@ describe('BlockingMergeRequestsReport', () => {
...
@@ -121,7 +121,7 @@ describe('BlockingMergeRequestsReport', () => {
it
(
'
puts closed MRs first
'
,
()
=>
{
it
(
'
puts closed MRs first
'
,
()
=>
{
createComponent
();
createComponent
();
const
closedIndex
=
wrapper
.
vm
.
unmergedBlockingMergeRequests
.
findIndex
(
const
closedIndex
=
wrapper
.
vm
.
unmergedBlockingMergeRequests
.
findIndex
(
mr
=>
mr
.
state
===
'
closed
'
,
(
mr
)
=>
mr
.
state
===
'
closed
'
,
);
);
expect
(
closedIndex
).
toBe
(
0
);
expect
(
closedIndex
).
toBe
(
0
);
...
...
ee/spec/frontend/vue_mr_widget/components/merge_train_helper_text_spec.js
View file @
39bb37cc
...
@@ -16,7 +16,7 @@ describe('MergeTrainHelperText', () => {
...
@@ -16,7 +16,7 @@ describe('MergeTrainHelperText', () => {
const
findDocumentationLink
=
()
=>
wrapper
.
find
(
'
[data-testid="documentation-link"]
'
);
const
findDocumentationLink
=
()
=>
wrapper
.
find
(
'
[data-testid="documentation-link"]
'
);
const
findPipelineLink
=
()
=>
wrapper
.
find
(
'
[data-testid="pipeline-link"]
'
);
const
findPipelineLink
=
()
=>
wrapper
.
find
(
'
[data-testid="pipeline-link"]
'
);
const
createWrapper
=
propsData
=>
{
const
createWrapper
=
(
propsData
)
=>
{
wrapper
=
shallowMount
(
MergeTrainHelperText
,
{
wrapper
=
shallowMount
(
MergeTrainHelperText
,
{
propsData
:
{
propsData
:
{
...
defaultProps
,
...
defaultProps
,
...
...
ee/spec/frontend/vue_mr_widget/components/merge_train_position_indicator_spec.js
View file @
39bb37cc
...
@@ -5,7 +5,7 @@ import { trimText } from 'helpers/text_helper';
...
@@ -5,7 +5,7 @@ import { trimText } from 'helpers/text_helper';
describe
(
'
MergeTrainPositionIndicator
'
,
()
=>
{
describe
(
'
MergeTrainPositionIndicator
'
,
()
=>
{
let
wrapper
;
let
wrapper
;
const
factory
=
propsData
=>
{
const
factory
=
(
propsData
)
=>
{
wrapper
=
shallowMount
(
MergeTrainPositionIndicator
,
{
wrapper
=
shallowMount
(
MergeTrainPositionIndicator
,
{
propsData
,
propsData
,
});
});
...
...
ee/spec/frontend/vue_mr_widget/components/mr_widget_pipeline_container_spec.js
View file @
39bb37cc
...
@@ -86,7 +86,7 @@ describe('MrWidgetPipelineContainer', () => {
...
@@ -86,7 +86,7 @@ describe('MrWidgetPipelineContainer', () => {
return
wrapper
.
vm
.
$nextTick
();
return
wrapper
.
vm
.
$nextTick
();
});
});
it
(
'
renders the visual review app link
'
,
done
=>
{
it
(
'
renders the visual review app link
'
,
(
done
)
=>
{
// the visual review app link component is lazy loaded
// the visual review app link component is lazy loaded
// so we need to re-render the component again, as once
// so we need to re-render the component again, as once
// apparently isn't enough.
// apparently isn't enough.
...
@@ -123,7 +123,7 @@ describe('MrWidgetPipelineContainer', () => {
...
@@ -123,7 +123,7 @@ describe('MrWidgetPipelineContainer', () => {
return
wrapper
.
vm
.
$nextTick
();
return
wrapper
.
vm
.
$nextTick
();
});
});
it
(
'
does not render the visual review app link
'
,
done
=>
{
it
(
'
does not render the visual review app link
'
,
(
done
)
=>
{
// the visual review app link component is lazy loaded
// the visual review app link component is lazy loaded
// so we need to re-render the component again, as once
// so we need to re-render the component again, as once
// apparently isn't enough.
// apparently isn't enough.
...
...
ee/spec/frontend/vue_mr_widget/ee_mr_widget_options_spec.js
View file @
39bb37cc
...
@@ -139,7 +139,7 @@ describe('ee merge request widget options', () => {
...
@@ -139,7 +139,7 @@ describe('ee merge request widget options', () => {
vm
=
mountComponent
(
Component
,
{
mrData
:
gl
.
mrWidgetData
});
vm
=
mountComponent
(
Component
,
{
mrData
:
gl
.
mrWidgetData
});
});
});
it
(
'
should render provided data
'
,
done
=>
{
it
(
'
should render provided data
'
,
(
done
)
=>
{
setImmediate
(()
=>
{
setImmediate
(()
=>
{
expect
(
expect
(
trimText
(
trimText
(
...
@@ -161,7 +161,7 @@ describe('ee merge request widget options', () => {
...
@@ -161,7 +161,7 @@ describe('ee merge request widget options', () => {
vm
=
mountComponent
(
Component
,
{
mrData
:
gl
.
mrWidgetData
});
vm
=
mountComponent
(
Component
,
{
mrData
:
gl
.
mrWidgetData
});
});
});
it
(
'
should render provided data
'
,
done
=>
{
it
(
'
should render provided data
'
,
(
done
)
=>
{
setImmediate
(()
=>
{
setImmediate
(()
=>
{
expect
(
expect
(
trimText
(
trimText
(
...
@@ -183,7 +183,7 @@ describe('ee merge request widget options', () => {
...
@@ -183,7 +183,7 @@ describe('ee merge request widget options', () => {
vm
=
mountComponent
(
Component
,
{
mrData
:
gl
.
mrWidgetData
});
vm
=
mountComponent
(
Component
,
{
mrData
:
gl
.
mrWidgetData
});
});
});
it
(
'
should render error indicator
'
,
done
=>
{
it
(
'
should render error indicator
'
,
(
done
)
=>
{
setImmediate
(()
=>
{
setImmediate
(()
=>
{
expect
(
expect
(
trimText
(
findExtendedSecurityWidget
().
querySelector
(
SAST_SELECTOR
).
textContent
),
trimText
(
findExtendedSecurityWidget
().
querySelector
(
SAST_SELECTOR
).
textContent
),
...
@@ -234,7 +234,7 @@ describe('ee merge request widget options', () => {
...
@@ -234,7 +234,7 @@ describe('ee merge request widget options', () => {
vm
=
mountComponent
(
Component
,
{
mrData
:
gl
.
mrWidgetData
});
vm
=
mountComponent
(
Component
,
{
mrData
:
gl
.
mrWidgetData
});
});
});
it
(
'
should render provided data
'
,
done
=>
{
it
(
'
should render provided data
'
,
(
done
)
=>
{
setImmediate
(()
=>
{
setImmediate
(()
=>
{
expect
(
expect
(
trimText
(
trimText
(
...
@@ -262,7 +262,7 @@ describe('ee merge request widget options', () => {
...
@@ -262,7 +262,7 @@ describe('ee merge request widget options', () => {
vm
=
mountComponent
(
Component
,
{
mrData
:
gl
.
mrWidgetData
});
vm
=
mountComponent
(
Component
,
{
mrData
:
gl
.
mrWidgetData
});
});
});
it
(
'
renders no vulnerabilities message
'
,
done
=>
{
it
(
'
renders no vulnerabilities message
'
,
(
done
)
=>
{
setImmediate
(()
=>
{
setImmediate
(()
=>
{
expect
(
expect
(
trimText
(
trimText
(
...
@@ -284,7 +284,7 @@ describe('ee merge request widget options', () => {
...
@@ -284,7 +284,7 @@ describe('ee merge request widget options', () => {
vm
=
mountComponent
(
Component
,
{
mrData
:
gl
.
mrWidgetData
});
vm
=
mountComponent
(
Component
,
{
mrData
:
gl
.
mrWidgetData
});
});
});
it
(
'
should render provided data
'
,
done
=>
{
it
(
'
should render provided data
'
,
(
done
)
=>
{
setImmediate
(()
=>
{
setImmediate
(()
=>
{
expect
(
expect
(
trimText
(
trimText
(
...
@@ -305,7 +305,7 @@ describe('ee merge request widget options', () => {
...
@@ -305,7 +305,7 @@ describe('ee merge request widget options', () => {
vm
=
mountComponent
(
Component
,
{
mrData
:
gl
.
mrWidgetData
});
vm
=
mountComponent
(
Component
,
{
mrData
:
gl
.
mrWidgetData
});
});
});
it
(
'
should render error indicator
'
,
done
=>
{
it
(
'
should render error indicator
'
,
(
done
)
=>
{
setImmediate
(()
=>
{
setImmediate
(()
=>
{
expect
(
expect
(
trimText
(
trimText
(
...
@@ -327,7 +327,7 @@ describe('ee merge request widget options', () => {
...
@@ -327,7 +327,7 @@ describe('ee merge request widget options', () => {
});
});
describe
(
'
when it is loading
'
,
()
=>
{
describe
(
'
when it is loading
'
,
()
=>
{
it
(
'
should render loading indicator
'
,
done
=>
{
it
(
'
should render loading indicator
'
,
(
done
)
=>
{
mock
.
onGet
(
'
head.json
'
).
reply
(
200
,
headBrowserPerformance
);
mock
.
onGet
(
'
head.json
'
).
reply
(
200
,
headBrowserPerformance
);
mock
.
onGet
(
'
base.json
'
).
reply
(
200
,
baseBrowserPerformance
);
mock
.
onGet
(
'
base.json
'
).
reply
(
200
,
baseBrowserPerformance
);
vm
=
mountComponent
(
Component
,
{
mrData
:
gl
.
mrWidgetData
});
vm
=
mountComponent
(
Component
,
{
mrData
:
gl
.
mrWidgetData
});
...
@@ -356,7 +356,7 @@ describe('ee merge request widget options', () => {
...
@@ -356,7 +356,7 @@ describe('ee merge request widget options', () => {
setBrowserPerformance
();
setBrowserPerformance
();
});
});
it
(
'
should render provided data
'
,
done
=>
{
it
(
'
should render provided data
'
,
(
done
)
=>
{
setImmediate
(()
=>
{
setImmediate
(()
=>
{
expect
(
expect
(
trimText
(
trimText
(
...
@@ -368,7 +368,7 @@ describe('ee merge request widget options', () => {
...
@@ -368,7 +368,7 @@ describe('ee merge request widget options', () => {
});
});
describe
(
'
text connector
'
,
()
=>
{
describe
(
'
text connector
'
,
()
=>
{
it
(
'
should only render information about fixed issues
'
,
done
=>
{
it
(
'
should only render information about fixed issues
'
,
(
done
)
=>
{
setImmediate
(()
=>
{
setImmediate
(()
=>
{
vm
.
mr
.
browserPerformanceMetrics
.
degraded
=
[];
vm
.
mr
.
browserPerformanceMetrics
.
degraded
=
[];
vm
.
mr
.
browserPerformanceMetrics
.
same
=
[];
vm
.
mr
.
browserPerformanceMetrics
.
same
=
[];
...
@@ -385,7 +385,7 @@ describe('ee merge request widget options', () => {
...
@@ -385,7 +385,7 @@ describe('ee merge request widget options', () => {
});
});
});
});
it
(
'
should only render information about added issues
'
,
done
=>
{
it
(
'
should only render information about added issues
'
,
(
done
)
=>
{
setImmediate
(()
=>
{
setImmediate
(()
=>
{
vm
.
mr
.
browserPerformanceMetrics
.
improved
=
[];
vm
.
mr
.
browserPerformanceMetrics
.
improved
=
[];
vm
.
mr
.
browserPerformanceMetrics
.
same
=
[];
vm
.
mr
.
browserPerformanceMetrics
.
same
=
[];
...
@@ -431,7 +431,7 @@ describe('ee merge request widget options', () => {
...
@@ -431,7 +431,7 @@ describe('ee merge request widget options', () => {
});
});
describe
(
'
with empty successful request
'
,
()
=>
{
describe
(
'
with empty successful request
'
,
()
=>
{
beforeEach
(
done
=>
{
beforeEach
(
(
done
)
=>
{
mock
.
onGet
(
DEFAULT_BROWSER_PERFORMANCE
.
head_path
).
reply
(
200
,
[]);
mock
.
onGet
(
DEFAULT_BROWSER_PERFORMANCE
.
head_path
).
reply
(
200
,
[]);
mock
.
onGet
(
DEFAULT_BROWSER_PERFORMANCE
.
base_path
).
reply
(
200
,
[]);
mock
.
onGet
(
DEFAULT_BROWSER_PERFORMANCE
.
base_path
).
reply
(
200
,
[]);
vm
=
mountComponent
(
Component
,
{
mrData
:
gl
.
mrWidgetData
});
vm
=
mountComponent
(
Component
,
{
mrData
:
gl
.
mrWidgetData
});
...
@@ -476,7 +476,7 @@ describe('ee merge request widget options', () => {
...
@@ -476,7 +476,7 @@ describe('ee merge request widget options', () => {
vm
.
mr
.
browserPerformance
=
gl
.
mrWidgetData
.
browserPerformance
;
vm
.
mr
.
browserPerformance
=
gl
.
mrWidgetData
.
browserPerformance
;
});
});
it
(
'
should render error indicator
'
,
done
=>
{
it
(
'
should render error indicator
'
,
(
done
)
=>
{
setImmediate
(()
=>
{
setImmediate
(()
=>
{
expect
(
expect
(
trimText
(
trimText
(
...
@@ -498,7 +498,7 @@ describe('ee merge request widget options', () => {
...
@@ -498,7 +498,7 @@ describe('ee merge request widget options', () => {
});
});
describe
(
'
when it is loading
'
,
()
=>
{
describe
(
'
when it is loading
'
,
()
=>
{
it
(
'
should render loading indicator
'
,
done
=>
{
it
(
'
should render loading indicator
'
,
(
done
)
=>
{
mock
.
onGet
(
DEFAULT_LOAD_PERFORMANCE
.
head_path
).
reply
(
200
,
headLoadPerformance
);
mock
.
onGet
(
DEFAULT_LOAD_PERFORMANCE
.
head_path
).
reply
(
200
,
headLoadPerformance
);
mock
.
onGet
(
DEFAULT_LOAD_PERFORMANCE
.
base_path
).
reply
(
200
,
baseLoadPerformance
);
mock
.
onGet
(
DEFAULT_LOAD_PERFORMANCE
.
base_path
).
reply
(
200
,
baseLoadPerformance
);
vm
=
mountComponent
(
Component
,
{
mrData
:
gl
.
mrWidgetData
});
vm
=
mountComponent
(
Component
,
{
mrData
:
gl
.
mrWidgetData
});
...
@@ -523,7 +523,7 @@ describe('ee merge request widget options', () => {
...
@@ -523,7 +523,7 @@ describe('ee merge request widget options', () => {
});
});
describe
(
'
default
'
,
()
=>
{
describe
(
'
default
'
,
()
=>
{
beforeEach
(
done
=>
{
beforeEach
(
(
done
)
=>
{
setLoadPerformance
();
setLoadPerformance
();
// wait for network request from component watch update method
// wait for network request from component watch update method
...
@@ -537,7 +537,7 @@ describe('ee merge request widget options', () => {
...
@@ -537,7 +537,7 @@ describe('ee merge request widget options', () => {
});
});
describe
(
'
text connector
'
,
()
=>
{
describe
(
'
text connector
'
,
()
=>
{
it
(
'
should only render information about fixed issues
'
,
done
=>
{
it
(
'
should only render information about fixed issues
'
,
(
done
)
=>
{
vm
.
mr
.
loadPerformanceMetrics
.
degraded
=
[];
vm
.
mr
.
loadPerformanceMetrics
.
degraded
=
[];
vm
.
mr
.
loadPerformanceMetrics
.
same
=
[];
vm
.
mr
.
loadPerformanceMetrics
.
same
=
[];
...
@@ -551,7 +551,7 @@ describe('ee merge request widget options', () => {
...
@@ -551,7 +551,7 @@ describe('ee merge request widget options', () => {
});
});
});
});
it
(
'
should only render information about added issues
'
,
done
=>
{
it
(
'
should only render information about added issues
'
,
(
done
)
=>
{
vm
.
mr
.
loadPerformanceMetrics
.
improved
=
[];
vm
.
mr
.
loadPerformanceMetrics
.
improved
=
[];
vm
.
mr
.
loadPerformanceMetrics
.
same
=
[];
vm
.
mr
.
loadPerformanceMetrics
.
same
=
[];
...
@@ -569,7 +569,7 @@ describe('ee merge request widget options', () => {
...
@@ -569,7 +569,7 @@ describe('ee merge request widget options', () => {
});
});
describe
(
'
with empty successful request
'
,
()
=>
{
describe
(
'
with empty successful request
'
,
()
=>
{
beforeEach
(
done
=>
{
beforeEach
(
(
done
)
=>
{
mock
.
onGet
(
DEFAULT_LOAD_PERFORMANCE
.
head_path
).
reply
(
200
,
{});
mock
.
onGet
(
DEFAULT_LOAD_PERFORMANCE
.
head_path
).
reply
(
200
,
{});
mock
.
onGet
(
DEFAULT_LOAD_PERFORMANCE
.
base_path
).
reply
(
200
,
{});
mock
.
onGet
(
DEFAULT_LOAD_PERFORMANCE
.
base_path
).
reply
(
200
,
{});
vm
=
mountComponent
(
Component
,
{
mrData
:
gl
.
mrWidgetData
});
vm
=
mountComponent
(
Component
,
{
mrData
:
gl
.
mrWidgetData
});
...
@@ -610,7 +610,7 @@ describe('ee merge request widget options', () => {
...
@@ -610,7 +610,7 @@ describe('ee merge request widget options', () => {
vm
.
mr
.
loadPerformance
=
gl
.
mrWidgetData
.
loadPerformance
;
vm
.
mr
.
loadPerformance
=
gl
.
mrWidgetData
.
loadPerformance
;
});
});
it
(
'
should render error indicator
'
,
done
=>
{
it
(
'
should render error indicator
'
,
(
done
)
=>
{
setImmediate
(()
=>
{
setImmediate
(()
=>
{
expect
(
expect
(
trimText
(
vm
.
$el
.
querySelector
(
'
.js-load-performance-widget .js-code-text
'
).
textContent
),
trimText
(
vm
.
$el
.
querySelector
(
'
.js-load-performance-widget .js-code-text
'
).
textContent
),
...
@@ -661,7 +661,7 @@ describe('ee merge request widget options', () => {
...
@@ -661,7 +661,7 @@ describe('ee merge request widget options', () => {
vm
=
mountComponent
(
Component
,
{
mrData
:
gl
.
mrWidgetData
});
vm
=
mountComponent
(
Component
,
{
mrData
:
gl
.
mrWidgetData
});
});
});
it
(
'
should render provided data
'
,
done
=>
{
it
(
'
should render provided data
'
,
(
done
)
=>
{
setImmediate
(()
=>
{
setImmediate
(()
=>
{
expect
(
expect
(
trimText
(
trimText
(
...
@@ -685,7 +685,7 @@ describe('ee merge request widget options', () => {
...
@@ -685,7 +685,7 @@ describe('ee merge request widget options', () => {
vm
=
mountComponent
(
Component
,
{
mrData
:
gl
.
mrWidgetData
});
vm
=
mountComponent
(
Component
,
{
mrData
:
gl
.
mrWidgetData
});
});
});
it
(
'
should render error indicator
'
,
done
=>
{
it
(
'
should render error indicator
'
,
(
done
)
=>
{
setImmediate
(()
=>
{
setImmediate
(()
=>
{
expect
(
expect
(
findExtendedSecurityWidget
()
findExtendedSecurityWidget
()
...
@@ -736,7 +736,7 @@ describe('ee merge request widget options', () => {
...
@@ -736,7 +736,7 @@ describe('ee merge request widget options', () => {
vm
=
mountComponent
(
Component
,
{
mrData
:
gl
.
mrWidgetData
});
vm
=
mountComponent
(
Component
,
{
mrData
:
gl
.
mrWidgetData
});
});
});
it
(
'
should render provided data
'
,
done
=>
{
it
(
'
should render provided data
'
,
(
done
)
=>
{
setImmediate
(()
=>
{
setImmediate
(()
=>
{
expect
(
expect
(
trimText
(
trimText
(
...
@@ -758,7 +758,7 @@ describe('ee merge request widget options', () => {
...
@@ -758,7 +758,7 @@ describe('ee merge request widget options', () => {
vm
=
mountComponent
(
Component
,
{
mrData
:
gl
.
mrWidgetData
});
vm
=
mountComponent
(
Component
,
{
mrData
:
gl
.
mrWidgetData
});
});
});
it
(
'
should render error indicator
'
,
done
=>
{
it
(
'
should render error indicator
'
,
(
done
)
=>
{
setImmediate
(()
=>
{
setImmediate
(()
=>
{
expect
(
expect
(
findExtendedSecurityWidget
().
querySelector
(
DAST_SELECTOR
).
textContent
.
trim
(),
findExtendedSecurityWidget
().
querySelector
(
DAST_SELECTOR
).
textContent
.
trim
(),
...
@@ -810,7 +810,7 @@ describe('ee merge request widget options', () => {
...
@@ -810,7 +810,7 @@ describe('ee merge request widget options', () => {
vm
=
mountWithFeatureFlag
();
vm
=
mountWithFeatureFlag
();
});
});
it
(
'
should render provided data
'
,
done
=>
{
it
(
'
should render provided data
'
,
(
done
)
=>
{
setImmediate
(()
=>
{
setImmediate
(()
=>
{
expect
(
expect
(
trimText
(
trimText
(
...
@@ -833,7 +833,7 @@ describe('ee merge request widget options', () => {
...
@@ -833,7 +833,7 @@ describe('ee merge request widget options', () => {
vm
=
mountWithFeatureFlag
();
vm
=
mountWithFeatureFlag
();
});
});
it
(
'
should render error indicator
'
,
done
=>
{
it
(
'
should render error indicator
'
,
(
done
)
=>
{
setImmediate
(()
=>
{
setImmediate
(()
=>
{
expect
(
expect
(
findExtendedSecurityWidget
()
findExtendedSecurityWidget
()
...
@@ -887,7 +887,7 @@ describe('ee merge request widget options', () => {
...
@@ -887,7 +887,7 @@ describe('ee merge request widget options', () => {
vm
=
mountComponent
(
Component
,
{
mrData
:
gl
.
mrWidgetData
});
vm
=
mountComponent
(
Component
,
{
mrData
:
gl
.
mrWidgetData
});
});
});
it
(
'
should render provided data
'
,
done
=>
{
it
(
'
should render provided data
'
,
(
done
)
=>
{
setImmediate
(()
=>
{
setImmediate
(()
=>
{
expect
(
expect
(
trimText
(
trimText
(
...
@@ -911,7 +911,7 @@ describe('ee merge request widget options', () => {
...
@@ -911,7 +911,7 @@ describe('ee merge request widget options', () => {
vm
=
mountComponent
(
Component
,
{
mrData
:
gl
.
mrWidgetData
});
vm
=
mountComponent
(
Component
,
{
mrData
:
gl
.
mrWidgetData
});
});
});
it
(
'
should render error indicator
'
,
done
=>
{
it
(
'
should render error indicator
'
,
(
done
)
=>
{
setImmediate
(()
=>
{
setImmediate
(()
=>
{
expect
(
expect
(
findExtendedSecurityWidget
().
querySelector
(
SECRET_SCANNING_SELECTOR
).
textContent
.
trim
(),
findExtendedSecurityWidget
().
querySelector
(
SECRET_SCANNING_SELECTOR
).
textContent
.
trim
(),
...
@@ -957,7 +957,7 @@ describe('ee merge request widget options', () => {
...
@@ -957,7 +957,7 @@ describe('ee merge request widget options', () => {
vm
=
mountComponent
(
Component
,
{
mrData
:
gl
.
mrWidgetData
});
vm
=
mountComponent
(
Component
,
{
mrData
:
gl
.
mrWidgetData
});
});
});
it
(
'
should render provided data
'
,
done
=>
{
it
(
'
should render provided data
'
,
(
done
)
=>
{
setImmediate
(()
=>
{
setImmediate
(()
=>
{
expect
(
expect
(
trimText
(
trimText
(
...
@@ -981,7 +981,7 @@ describe('ee merge request widget options', () => {
...
@@ -981,7 +981,7 @@ describe('ee merge request widget options', () => {
vm
=
mountComponent
(
Component
,
{
mrData
:
gl
.
mrWidgetData
});
vm
=
mountComponent
(
Component
,
{
mrData
:
gl
.
mrWidgetData
});
});
});
it
(
'
should render error indicator
'
,
done
=>
{
it
(
'
should render error indicator
'
,
(
done
)
=>
{
setImmediate
(()
=>
{
setImmediate
(()
=>
{
expect
(
expect
(
findExtendedSecurityWidget
().
querySelector
(
API_FUZZING_SELECTOR
).
textContent
.
trim
(),
findExtendedSecurityWidget
().
querySelector
(
API_FUZZING_SELECTOR
).
textContent
.
trim
(),
...
@@ -1092,7 +1092,7 @@ describe('ee merge request widget options', () => {
...
@@ -1092,7 +1092,7 @@ describe('ee merge request widget options', () => {
});
});
});
});
it
(
'
renders when user cannot remove branch and branch should be removed
'
,
done
=>
{
it
(
'
renders when user cannot remove branch and branch should be removed
'
,
(
done
)
=>
{
vm
.
mr
.
canRemoveSourceBranch
=
false
;
vm
.
mr
.
canRemoveSourceBranch
=
false
;
vm
.
mr
.
shouldRemoveSourceBranch
=
true
;
vm
.
mr
.
shouldRemoveSourceBranch
=
true
;
vm
.
mr
.
state
=
'
readyToMerge
'
;
vm
.
mr
.
state
=
'
readyToMerge
'
;
...
@@ -1109,7 +1109,7 @@ describe('ee merge request widget options', () => {
...
@@ -1109,7 +1109,7 @@ describe('ee merge request widget options', () => {
});
});
});
});
it
(
'
does not render in merged state
'
,
done
=>
{
it
(
'
does not render in merged state
'
,
(
done
)
=>
{
vm
.
mr
.
canRemoveSourceBranch
=
false
;
vm
.
mr
.
canRemoveSourceBranch
=
false
;
vm
.
mr
.
shouldRemoveSourceBranch
=
true
;
vm
.
mr
.
shouldRemoveSourceBranch
=
true
;
vm
.
mr
.
state
=
'
merged
'
;
vm
.
mr
.
state
=
'
merged
'
;
...
@@ -1138,7 +1138,7 @@ describe('ee merge request widget options', () => {
...
@@ -1138,7 +1138,7 @@ describe('ee merge request widget options', () => {
status
:
SUCCESS
,
status
:
SUCCESS
,
};
};
beforeEach
(
done
=>
{
beforeEach
(
(
done
)
=>
{
vm
=
mountComponent
(
Component
,
{
vm
=
mountComponent
(
Component
,
{
mrData
:
{
mrData
:
{
...
mockData
,
...
mockData
,
...
@@ -1214,7 +1214,7 @@ describe('ee merge request widget options', () => {
...
@@ -1214,7 +1214,7 @@ describe('ee merge request widget options', () => {
},
},
];
];
noSecurityReportsEnabledCases
.
forEach
(
noSecurityReportsEnabled
=>
{
noSecurityReportsEnabledCases
.
forEach
(
(
noSecurityReportsEnabled
)
=>
{
it
(
'
does not render the security reports widget
'
,
()
=>
{
it
(
'
does not render the security reports widget
'
,
()
=>
{
gl
.
mrWidgetData
=
{
gl
.
mrWidgetData
=
{
...
mockData
,
...
mockData
,
...
...
ee/spec/frontend/vue_mr_widget/stores/mr_widget_store_spec.js
View file @
39bb37cc
...
@@ -78,7 +78,7 @@ describe('MergeRequestStore', () => {
...
@@ -78,7 +78,7 @@ describe('MergeRequestStore', () => {
'
secret_scanning_comparison_path
'
,
'
secret_scanning_comparison_path
'
,
'
api_fuzzing_comparison_path
'
,
'
api_fuzzing_comparison_path
'
,
'
coverage_fuzzing_comparison_path
'
,
'
coverage_fuzzing_comparison_path
'
,
])(
'
should set %s path
'
,
property
=>
{
])(
'
should set %s path
'
,
(
property
)
=>
{
// Ensure something is set in the mock data
// Ensure something is set in the mock data
expect
(
property
in
mockData
).
toBe
(
true
);
expect
(
property
in
mockData
).
toBe
(
true
);
const
expectedValue
=
mockData
[
property
];
const
expectedValue
=
mockData
[
property
];
...
...
ee/spec/frontend/vue_shared/components/accordion/accordion_item_spec.js
View file @
39bb37cc
...
@@ -74,7 +74,7 @@ describe('AccordionItem component', () => {
...
@@ -74,7 +74,7 @@ describe('AccordionItem component', () => {
});
});
describe
(
'
scoped slots
'
,
()
=>
{
describe
(
'
scoped slots
'
,
()
=>
{
it
.
each
([
'
default
'
,
'
title
'
])(
"
contains a '%s' slot
"
,
slotName
=>
{
it
.
each
([
'
default
'
,
'
title
'
])(
"
contains a '%s' slot
"
,
(
slotName
)
=>
{
const
className
=
`
${
slotName
}
-slot-content`
;
const
className
=
`
${
slotName
}
-slot-content`
;
factory
({
[
`
${
slotName
}
Slot`
]:
`<div class='
${
className
}
' />`
});
factory
({
[
`
${
slotName
}
Slot`
]:
`<div class='
${
className
}
' />`
});
...
@@ -89,7 +89,7 @@ describe('AccordionItem component', () => {
...
@@ -89,7 +89,7 @@ describe('AccordionItem component', () => {
it
.
each
([
true
,
false
])(
it
.
each
([
true
,
false
])(
'
passes the "isExpanded" and "isDisabled" state to the title slot
'
,
'
passes the "isExpanded" and "isDisabled" state to the title slot
'
,
state
=>
{
(
state
)
=>
{
const
titleSlot
=
jest
.
fn
();
const
titleSlot
=
jest
.
fn
();
factory
({
propsData
:
{
disabled
:
state
},
titleSlot
});
factory
({
propsData
:
{
disabled
:
state
},
titleSlot
});
...
...
ee/spec/frontend/vue_shared/components/deployment_instance/deployment_instance_spec.js
View file @
39bb37cc
...
@@ -28,7 +28,7 @@ describe('Deploy Board Instance', () => {
...
@@ -28,7 +28,7 @@ describe('Deploy Board Instance', () => {
expect
(
wrapper
.
attributes
(
'
title
'
)).
toEqual
(
'
This is a pod
'
);
expect
(
wrapper
.
attributes
(
'
title
'
)).
toEqual
(
'
This is a pod
'
);
});
});
it
(
'
should render a div without tooltip data
'
,
done
=>
{
it
(
'
should render a div without tooltip data
'
,
(
done
)
=>
{
wrapper
=
createComponent
({
wrapper
=
createComponent
({
status
:
'
deploying
'
,
status
:
'
deploying
'
,
tooltipText
:
''
,
tooltipText
:
''
,
...
@@ -58,7 +58,7 @@ describe('Deploy Board Instance', () => {
...
@@ -58,7 +58,7 @@ describe('Deploy Board Instance', () => {
wrapper
.
destroy
();
wrapper
.
destroy
();
});
});
it
(
'
should render a div with canary class when stable prop is provided as false
'
,
done
=>
{
it
(
'
should render a div with canary class when stable prop is provided as false
'
,
(
done
)
=>
{
wrapper
=
createComponent
({
wrapper
=
createComponent
({
stable
:
false
,
stable
:
false
,
});
});
...
@@ -75,7 +75,7 @@ describe('Deploy Board Instance', () => {
...
@@ -75,7 +75,7 @@ describe('Deploy Board Instance', () => {
wrapper
.
destroy
();
wrapper
.
destroy
();
});
});
it
(
'
should not be a link without a logsPath prop
'
,
done
=>
{
it
(
'
should not be a link without a logsPath prop
'
,
(
done
)
=>
{
wrapper
=
createComponent
({
wrapper
=
createComponent
({
stable
:
false
,
stable
:
false
,
logsPath
:
''
,
logsPath
:
''
,
...
...
ee/spec/frontend/vue_shared/components/notes/system_note_spec.js
View file @
39bb37cc
...
@@ -76,7 +76,7 @@ describe('system note component', () => {
...
@@ -76,7 +76,7 @@ describe('system note component', () => {
expect
(
findDescriptionVersion
().
exists
()).
toBe
(
false
);
expect
(
findDescriptionVersion
().
exists
()).
toBe
(
false
);
});
});
it
(
'
click on button to toggle description diff displays description diff with delete icon button
'
,
done
=>
{
it
(
'
click on button to toggle description diff displays description diff with delete icon button
'
,
(
done
)
=>
{
mockFetchDiff
();
mockFetchDiff
();
expect
(
findDescriptionVersion
().
exists
()).
toBe
(
false
);
expect
(
findDescriptionVersion
().
exists
()).
toBe
(
false
);
...
...
ee/spec/frontend/vue_shared/components/security_reports/severity_badge_spec.js
View file @
39bb37cc
...
@@ -29,7 +29,7 @@ describe('Severity Badge', () => {
...
@@ -29,7 +29,7 @@ describe('Severity Badge', () => {
const
findIcon
=
()
=>
wrapper
.
find
(
GlIcon
);
const
findIcon
=
()
=>
wrapper
.
find
(
GlIcon
);
const
findTooltip
=
()
=>
getBinding
(
findIcon
().
element
,
'
tooltip
'
).
value
;
const
findTooltip
=
()
=>
getBinding
(
findIcon
().
element
,
'
tooltip
'
).
value
;
describe
.
each
(
SEVERITY_LEVELS
)(
'
given a valid severity "%s"
'
,
severity
=>
{
describe
.
each
(
SEVERITY_LEVELS
)(
'
given a valid severity "%s"
'
,
(
severity
)
=>
{
beforeEach
(()
=>
{
beforeEach
(()
=>
{
createWrapper
({
severity
});
createWrapper
({
severity
});
});
});
...
@@ -54,7 +54,7 @@ describe('Severity Badge', () => {
...
@@ -54,7 +54,7 @@ describe('Severity Badge', () => {
});
});
});
});
describe
.
each
([
'
foo
'
,
''
,
'
'
])(
'
given an invalid severity "%s"
'
,
invalidSeverity
=>
{
describe
.
each
([
'
foo
'
,
''
,
'
'
])(
'
given an invalid severity "%s"
'
,
(
invalidSeverity
)
=>
{
beforeEach
(()
=>
{
beforeEach
(()
=>
{
createWrapper
({
severity
:
invalidSeverity
});
createWrapper
({
severity
:
invalidSeverity
});
});
});
...
...
ee/spec/frontend/vue_shared/components/sidebar/epics_select/base_spec.js
View file @
39bb37cc
...
@@ -224,7 +224,7 @@ describe('EpicsSelect', () => {
...
@@ -224,7 +224,7 @@ describe('EpicsSelect', () => {
expect
(
wrapperStandalone
.
find
(
DropdownTitle
).
exists
()).
toBe
(
false
);
expect
(
wrapperStandalone
.
find
(
DropdownTitle
).
exists
()).
toBe
(
false
);
});
});
it
(
'
should render DropdownValue component when `showDropdown` is false
'
,
done
=>
{
it
(
'
should render DropdownValue component when `showDropdown` is false
'
,
(
done
)
=>
{
wrapper
.
vm
.
showDropdown
=
false
;
wrapper
.
vm
.
showDropdown
=
false
;
wrapper
.
vm
.
$nextTick
(()
=>
{
wrapper
.
vm
.
$nextTick
(()
=>
{
...
@@ -237,7 +237,7 @@ describe('EpicsSelect', () => {
...
@@ -237,7 +237,7 @@ describe('EpicsSelect', () => {
expect
(
wrapperStandalone
.
find
(
DropdownValue
).
exists
()).
toBe
(
false
);
expect
(
wrapperStandalone
.
find
(
DropdownValue
).
exists
()).
toBe
(
false
);
});
});
it
(
'
should render dropdown container element when props `canEdit` & `showDropdown` are true
'
,
done
=>
{
it
(
'
should render dropdown container element when props `canEdit` & `showDropdown` are true
'
,
(
done
)
=>
{
showDropdown
();
showDropdown
();
wrapper
.
vm
.
$nextTick
(()
=>
{
wrapper
.
vm
.
$nextTick
(()
=>
{
...
@@ -251,7 +251,7 @@ describe('EpicsSelect', () => {
...
@@ -251,7 +251,7 @@ describe('EpicsSelect', () => {
expect
(
wrapperStandalone
.
find
(
'
.epic-dropdown-container
'
).
exists
()).
toBe
(
true
);
expect
(
wrapperStandalone
.
find
(
'
.epic-dropdown-container
'
).
exists
()).
toBe
(
true
);
});
});
it
(
'
should render DropdownButton component when props `canEdit` & `showDropdown` are true
'
,
done
=>
{
it
(
'
should render DropdownButton component when props `canEdit` & `showDropdown` are true
'
,
(
done
)
=>
{
showDropdown
();
showDropdown
();
wrapper
.
vm
.
$nextTick
(()
=>
{
wrapper
.
vm
.
$nextTick
(()
=>
{
...
@@ -260,7 +260,7 @@ describe('EpicsSelect', () => {
...
@@ -260,7 +260,7 @@ describe('EpicsSelect', () => {
});
});
});
});
it
(
'
should render dropdown menu container element when props `canEdit` & `showDropdown` are true
'
,
done
=>
{
it
(
'
should render dropdown menu container element when props `canEdit` & `showDropdown` are true
'
,
(
done
)
=>
{
showDropdown
();
showDropdown
();
wrapper
.
vm
.
$nextTick
(()
=>
{
wrapper
.
vm
.
$nextTick
(()
=>
{
...
@@ -269,7 +269,7 @@ describe('EpicsSelect', () => {
...
@@ -269,7 +269,7 @@ describe('EpicsSelect', () => {
});
});
});
});
it
(
'
should render DropdownHeader component when props `canEdit` & `showDropdown` are true
'
,
done
=>
{
it
(
'
should render DropdownHeader component when props `canEdit` & `showDropdown` are true
'
,
(
done
)
=>
{
showDropdown
();
showDropdown
();
wrapper
.
vm
.
$nextTick
(()
=>
{
wrapper
.
vm
.
$nextTick
(()
=>
{
...
@@ -286,7 +286,7 @@ describe('EpicsSelect', () => {
...
@@ -286,7 +286,7 @@ describe('EpicsSelect', () => {
});
});
});
});
it
(
'
should render DropdownSearchInput component when props `canEdit` & `showDropdown` are true
'
,
done
=>
{
it
(
'
should render DropdownSearchInput component when props `canEdit` & `showDropdown` are true
'
,
(
done
)
=>
{
showDropdown
();
showDropdown
();
wrapper
.
vm
.
$nextTick
(()
=>
{
wrapper
.
vm
.
$nextTick
(()
=>
{
...
@@ -295,7 +295,7 @@ describe('EpicsSelect', () => {
...
@@ -295,7 +295,7 @@ describe('EpicsSelect', () => {
});
});
});
});
it
(
'
should render DropdownContents component when props `canEdit` & `showDropdown` are true and `isEpicsLoading` is false
'
,
done
=>
{
it
(
'
should render DropdownContents component when props `canEdit` & `showDropdown` are true and `isEpicsLoading` is false
'
,
(
done
)
=>
{
showDropdown
();
showDropdown
();
store
.
dispatch
(
'
receiveEpicsSuccess
'
,
[]);
store
.
dispatch
(
'
receiveEpicsSuccess
'
,
[]);
...
@@ -305,7 +305,7 @@ describe('EpicsSelect', () => {
...
@@ -305,7 +305,7 @@ describe('EpicsSelect', () => {
});
});
});
});
it
(
'
should render GlLoadingIcon component when props `canEdit` & `showDropdown` and `isEpicsLoading` are true
'
,
done
=>
{
it
(
'
should render GlLoadingIcon component when props `canEdit` & `showDropdown` and `isEpicsLoading` are true
'
,
(
done
)
=>
{
showDropdown
();
showDropdown
();
store
.
dispatch
(
'
requestEpics
'
);
store
.
dispatch
(
'
requestEpics
'
);
...
...
ee/spec/frontend/vue_shared/components/sidebar/epics_select/dropdown_contents_spec.js
View file @
39bb37cc
...
@@ -6,7 +6,7 @@ import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils';
...
@@ -6,7 +6,7 @@ import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils';
import
{
mockEpic1
,
mockEpic2
,
mockEpics
,
noneEpic
}
from
'
../mock_data
'
;
import
{
mockEpic1
,
mockEpic2
,
mockEpics
,
noneEpic
}
from
'
../mock_data
'
;
const
epics
=
mockEpics
.
map
(
epic
=>
convertObjectPropsToCamelCase
(
epic
));
const
epics
=
mockEpics
.
map
(
(
epic
)
=>
convertObjectPropsToCamelCase
(
epic
));
describe
(
'
EpicsSelect
'
,
()
=>
{
describe
(
'
EpicsSelect
'
,
()
=>
{
describe
(
'
DropdownContents
'
,
()
=>
{
describe
(
'
DropdownContents
'
,
()
=>
{
...
@@ -27,7 +27,7 @@ describe('EpicsSelect', () => {
...
@@ -27,7 +27,7 @@ describe('EpicsSelect', () => {
describe
(
'
computed
'
,
()
=>
{
describe
(
'
computed
'
,
()
=>
{
describe
(
'
isNoEpic
'
,
()
=>
{
describe
(
'
isNoEpic
'
,
()
=>
{
it
(
'
should return true when `selectedEpic` is of type `No Epic`
'
,
done
=>
{
it
(
'
should return true when `selectedEpic` is of type `No Epic`
'
,
(
done
)
=>
{
wrapper
.
setProps
({
wrapper
.
setProps
({
selectedEpic
:
noneEpic
,
selectedEpic
:
noneEpic
,
});
});
...
...
ee/spec/frontend/vue_shared/components/sidebar/epics_select/store/actions_spec.js
View file @
39bb37cc
...
@@ -15,7 +15,7 @@ describe('EpicsSelect', () => {
...
@@ -15,7 +15,7 @@ describe('EpicsSelect', () => {
describe
(
'
store
'
,
()
=>
{
describe
(
'
store
'
,
()
=>
{
describe
(
'
actions
'
,
()
=>
{
describe
(
'
actions
'
,
()
=>
{
let
state
;
let
state
;
const
normalizedEpics
=
mockEpics
.
map
(
rawEpic
=>
const
normalizedEpics
=
mockEpics
.
map
(
(
rawEpic
)
=>
convertObjectPropsToCamelCase
(
Object
.
assign
(
rawEpic
,
{
url
:
rawEpic
.
web_edit_url
}),
{
convertObjectPropsToCamelCase
(
Object
.
assign
(
rawEpic
,
{
url
:
rawEpic
.
web_edit_url
}),
{
dropKeys
:
[
'
web_edit_url
'
],
dropKeys
:
[
'
web_edit_url
'
],
}),
}),
...
@@ -26,7 +26,7 @@ describe('EpicsSelect', () => {
...
@@ -26,7 +26,7 @@ describe('EpicsSelect', () => {
});
});
describe
(
'
setInitialData
'
,
()
=>
{
describe
(
'
setInitialData
'
,
()
=>
{
it
(
'
should set initial data on state
'
,
done
=>
{
it
(
'
should set initial data on state
'
,
(
done
)
=>
{
const
mockInitialConfig
=
{
const
mockInitialConfig
=
{
groupId
:
mockEpic1
.
group_id
,
groupId
:
mockEpic1
.
group_id
,
issueId
:
mockIssue
.
id
,
issueId
:
mockIssue
.
id
,
...
@@ -46,7 +46,7 @@ describe('EpicsSelect', () => {
...
@@ -46,7 +46,7 @@ describe('EpicsSelect', () => {
});
});
describe
(
'
setIssueId
'
,
()
=>
{
describe
(
'
setIssueId
'
,
()
=>
{
it
(
'
should set `issueId` on state
'
,
done
=>
{
it
(
'
should set `issueId` on state
'
,
(
done
)
=>
{
const
issueId
=
mockIssue
.
id
;
const
issueId
=
mockIssue
.
id
;
testAction
(
testAction
(
...
@@ -61,7 +61,7 @@ describe('EpicsSelect', () => {
...
@@ -61,7 +61,7 @@ describe('EpicsSelect', () => {
});
});
describe
(
'
setSearchQuery
'
,
()
=>
{
describe
(
'
setSearchQuery
'
,
()
=>
{
it
(
'
should set `searchQuery` param on state
'
,
done
=>
{
it
(
'
should set `searchQuery` param on state
'
,
(
done
)
=>
{
const
searchQuery
=
'
foo
'
;
const
searchQuery
=
'
foo
'
;
testAction
(
testAction
(
...
@@ -76,7 +76,7 @@ describe('EpicsSelect', () => {
...
@@ -76,7 +76,7 @@ describe('EpicsSelect', () => {
});
});
describe
(
'
setSelectedEpic
'
,
()
=>
{
describe
(
'
setSelectedEpic
'
,
()
=>
{
it
(
'
should set `selectedEpic` param on state
'
,
done
=>
{
it
(
'
should set `selectedEpic` param on state
'
,
(
done
)
=>
{
testAction
(
testAction
(
actions
.
setSelectedEpic
,
actions
.
setSelectedEpic
,
mockEpic1
,
mockEpic1
,
...
@@ -89,7 +89,7 @@ describe('EpicsSelect', () => {
...
@@ -89,7 +89,7 @@ describe('EpicsSelect', () => {
});
});
describe
(
'
setSelectedEpicIssueId
'
,
()
=>
{
describe
(
'
setSelectedEpicIssueId
'
,
()
=>
{
it
(
'
should set `selectedEpicIssueId` param on state
'
,
done
=>
{
it
(
'
should set `selectedEpicIssueId` param on state
'
,
(
done
)
=>
{
testAction
(
testAction
(
actions
.
setSelectedEpicIssueId
,
actions
.
setSelectedEpicIssueId
,
mockIssue
.
epic_issue_id
,
mockIssue
.
epic_issue_id
,
...
@@ -102,13 +102,13 @@ describe('EpicsSelect', () => {
...
@@ -102,13 +102,13 @@ describe('EpicsSelect', () => {
});
});
describe
(
'
requestEpics
'
,
()
=>
{
describe
(
'
requestEpics
'
,
()
=>
{
it
(
'
should set `state.epicsFetchInProgress` to true
'
,
done
=>
{
it
(
'
should set `state.epicsFetchInProgress` to true
'
,
(
done
)
=>
{
testAction
(
actions
.
requestEpics
,
{},
state
,
[{
type
:
types
.
REQUEST_EPICS
}],
[],
done
);
testAction
(
actions
.
requestEpics
,
{},
state
,
[{
type
:
types
.
REQUEST_EPICS
}],
[],
done
);
});
});
});
});
describe
(
'
receiveEpicsSuccess
'
,
()
=>
{
describe
(
'
receiveEpicsSuccess
'
,
()
=>
{
it
(
'
should set processed Epics array to `state.epics`
'
,
done
=>
{
it
(
'
should set processed Epics array to `state.epics`
'
,
(
done
)
=>
{
state
.
groupId
=
mockEpic1
.
group_id
;
state
.
groupId
=
mockEpic1
.
group_id
;
testAction
(
testAction
(
...
@@ -137,7 +137,7 @@ describe('EpicsSelect', () => {
...
@@ -137,7 +137,7 @@ describe('EpicsSelect', () => {
);
);
});
});
it
(
'
should set `state.epicsFetchInProgress` to false
'
,
done
=>
{
it
(
'
should set `state.epicsFetchInProgress` to false
'
,
(
done
)
=>
{
testAction
(
testAction
(
actions
.
receiveEpicsFailure
,
actions
.
receiveEpicsFailure
,
{},
{},
...
@@ -154,7 +154,7 @@ describe('EpicsSelect', () => {
...
@@ -154,7 +154,7 @@ describe('EpicsSelect', () => {
state
.
groupId
=
mockEpic1
.
group_id
;
state
.
groupId
=
mockEpic1
.
group_id
;
});
});
it
(
'
should dispatch `requestEpics` & call `Api.groupEpics` and then dispatch `receiveEpicsSuccess` on request success
'
,
done
=>
{
it
(
'
should dispatch `requestEpics` & call `Api.groupEpics` and then dispatch `receiveEpicsSuccess` on request success
'
,
(
done
)
=>
{
jest
.
spyOn
(
Api
,
'
groupEpics
'
).
mockReturnValue
(
jest
.
spyOn
(
Api
,
'
groupEpics
'
).
mockReturnValue
(
Promise
.
resolve
({
Promise
.
resolve
({
data
:
mockEpics
,
data
:
mockEpics
,
...
@@ -179,7 +179,7 @@ describe('EpicsSelect', () => {
...
@@ -179,7 +179,7 @@ describe('EpicsSelect', () => {
);
);
});
});
it
(
'
should dispatch `requestEpics` & call `Api.groupEpics` and then dispatch `receiveEpicsFailure` on request failure
'
,
done
=>
{
it
(
'
should dispatch `requestEpics` & call `Api.groupEpics` and then dispatch `receiveEpicsFailure` on request failure
'
,
(
done
)
=>
{
jest
.
spyOn
(
Api
,
'
groupEpics
'
).
mockReturnValue
(
Promise
.
reject
());
jest
.
spyOn
(
Api
,
'
groupEpics
'
).
mockReturnValue
(
Promise
.
reject
());
testAction
(
testAction
(
...
@@ -224,7 +224,7 @@ describe('EpicsSelect', () => {
...
@@ -224,7 +224,7 @@ describe('EpicsSelect', () => {
});
});
describe
(
'
requestIssueUpdate
'
,
()
=>
{
describe
(
'
requestIssueUpdate
'
,
()
=>
{
it
(
'
should set `state.epicSelectInProgress` to true
'
,
done
=>
{
it
(
'
should set `state.epicSelectInProgress` to true
'
,
(
done
)
=>
{
testAction
(
testAction
(
actions
.
requestIssueUpdate
,
actions
.
requestIssueUpdate
,
{},
{},
...
@@ -237,7 +237,7 @@ describe('EpicsSelect', () => {
...
@@ -237,7 +237,7 @@ describe('EpicsSelect', () => {
});
});
describe
(
'
receiveIssueUpdateSuccess
'
,
()
=>
{
describe
(
'
receiveIssueUpdateSuccess
'
,
()
=>
{
it
(
'
should set updated selectedEpic with passed Epic instance to state when payload has matching Epic and Issue IDs
'
,
done
=>
{
it
(
'
should set updated selectedEpic with passed Epic instance to state when payload has matching Epic and Issue IDs
'
,
(
done
)
=>
{
state
.
issueId
=
mockIssue
.
id
;
state
.
issueId
=
mockIssue
.
id
;
testAction
(
testAction
(
...
@@ -261,7 +261,7 @@ describe('EpicsSelect', () => {
...
@@ -261,7 +261,7 @@ describe('EpicsSelect', () => {
);
);
});
});
it
(
'
should update the epic associated with the issue in BoardsStore if the update happened in Boards
'
,
done
=>
{
it
(
'
should update the epic associated with the issue in BoardsStore if the update happened in Boards
'
,
(
done
)
=>
{
boardsStore
.
detail
.
issue
.
updateEpic
=
jest
.
fn
(()
=>
{});
boardsStore
.
detail
.
issue
.
updateEpic
=
jest
.
fn
(()
=>
{});
state
.
issueId
=
mockIssue
.
id
;
state
.
issueId
=
mockIssue
.
id
;
const
mockApiData
=
{
...
mockAssignRemoveRes
};
const
mockApiData
=
{
...
mockAssignRemoveRes
};
...
@@ -290,7 +290,7 @@ describe('EpicsSelect', () => {
...
@@ -290,7 +290,7 @@ describe('EpicsSelect', () => {
expect
(
boardsStore
.
detail
.
issue
.
updateEpic
).
toHaveBeenCalled
();
expect
(
boardsStore
.
detail
.
issue
.
updateEpic
).
toHaveBeenCalled
();
});
});
it
(
'
should set updated selectedEpic with noneEpic to state when payload has matching Epic and Issue IDs and isRemoval param is true
'
,
done
=>
{
it
(
'
should set updated selectedEpic with noneEpic to state when payload has matching Epic and Issue IDs and isRemoval param is true
'
,
(
done
)
=>
{
state
.
issueId
=
mockIssue
.
id
;
state
.
issueId
=
mockIssue
.
id
;
testAction
(
testAction
(
...
@@ -315,7 +315,7 @@ describe('EpicsSelect', () => {
...
@@ -315,7 +315,7 @@ describe('EpicsSelect', () => {
);
);
});
});
it
(
'
should not do any mutation to the state whe payload does not have matching Epic and Issue IDs
'
,
done
=>
{
it
(
'
should not do any mutation to the state whe payload does not have matching Epic and Issue IDs
'
,
(
done
)
=>
{
testAction
(
testAction
(
actions
.
receiveIssueUpdateSuccess
,
actions
.
receiveIssueUpdateSuccess
,
{
{
...
@@ -349,7 +349,7 @@ describe('EpicsSelect', () => {
...
@@ -349,7 +349,7 @@ describe('EpicsSelect', () => {
);
);
});
});
it
(
'
should set `state.epicSelectInProgress` to false
'
,
done
=>
{
it
(
'
should set `state.epicSelectInProgress` to false
'
,
(
done
)
=>
{
testAction
(
testAction
(
actions
.
receiveIssueUpdateFailure
,
actions
.
receiveIssueUpdateFailure
,
{},
{},
...
@@ -366,7 +366,7 @@ describe('EpicsSelect', () => {
...
@@ -366,7 +366,7 @@ describe('EpicsSelect', () => {
state
.
issueId
=
mockIssue
.
id
;
state
.
issueId
=
mockIssue
.
id
;
});
});
it
(
'
should dispatch `requestIssueUpdate` & call `Api.addEpicIssue` and then dispatch `receiveIssueUpdateSuccess` on request success
'
,
done
=>
{
it
(
'
should dispatch `requestIssueUpdate` & call `Api.addEpicIssue` and then dispatch `receiveIssueUpdateSuccess` on request success
'
,
(
done
)
=>
{
jest
.
spyOn
(
Api
,
'
addEpicIssue
'
).
mockReturnValue
(
jest
.
spyOn
(
Api
,
'
addEpicIssue
'
).
mockReturnValue
(
Promise
.
resolve
({
Promise
.
resolve
({
data
:
mockAssignRemoveRes
,
data
:
mockAssignRemoveRes
,
...
@@ -391,7 +391,7 @@ describe('EpicsSelect', () => {
...
@@ -391,7 +391,7 @@ describe('EpicsSelect', () => {
);
);
});
});
it
(
'
should dispatch `requestIssueUpdate` & call `Api.addEpicIssue` and then dispatch `receiveIssueUpdateFailure` on request failure
'
,
done
=>
{
it
(
'
should dispatch `requestIssueUpdate` & call `Api.addEpicIssue` and then dispatch `receiveIssueUpdateFailure` on request failure
'
,
(
done
)
=>
{
jest
.
spyOn
(
Api
,
'
addEpicIssue
'
).
mockReturnValue
(
Promise
.
reject
());
jest
.
spyOn
(
Api
,
'
addEpicIssue
'
).
mockReturnValue
(
Promise
.
reject
());
testAction
(
testAction
(
...
@@ -440,7 +440,7 @@ describe('EpicsSelect', () => {
...
@@ -440,7 +440,7 @@ describe('EpicsSelect', () => {
state
.
selectedEpicIssueId
=
mockIssue
.
epic_issue_id
;
state
.
selectedEpicIssueId
=
mockIssue
.
epic_issue_id
;
});
});
it
(
'
should dispatch `requestIssueUpdate` & call `Api.removeEpicIssue` and then dispatch `receiveIssueUpdateSuccess` on request success
'
,
done
=>
{
it
(
'
should dispatch `requestIssueUpdate` & call `Api.removeEpicIssue` and then dispatch `receiveIssueUpdateSuccess` on request success
'
,
(
done
)
=>
{
jest
.
spyOn
(
Api
,
'
removeEpicIssue
'
).
mockReturnValue
(
jest
.
spyOn
(
Api
,
'
removeEpicIssue
'
).
mockReturnValue
(
Promise
.
resolve
({
Promise
.
resolve
({
data
:
mockAssignRemoveRes
,
data
:
mockAssignRemoveRes
,
...
@@ -465,7 +465,7 @@ describe('EpicsSelect', () => {
...
@@ -465,7 +465,7 @@ describe('EpicsSelect', () => {
);
);
});
});
it
(
'
should dispatch `requestIssueUpdate` & call `Api.removeEpicIssue` and then dispatch `receiveIssueUpdateFailure` on request failure
'
,
done
=>
{
it
(
'
should dispatch `requestIssueUpdate` & call `Api.removeEpicIssue` and then dispatch `receiveIssueUpdateFailure` on request failure
'
,
(
done
)
=>
{
jest
.
spyOn
(
Api
,
'
removeEpicIssue
'
).
mockReturnValue
(
Promise
.
reject
());
jest
.
spyOn
(
Api
,
'
removeEpicIssue
'
).
mockReturnValue
(
Promise
.
reject
());
testAction
(
testAction
(
...
...
ee/spec/frontend/vue_shared/components/sidebar/epics_select/store/getters_spec.js
View file @
39bb37cc
...
@@ -9,7 +9,7 @@ describe('EpicsSelect', () => {
...
@@ -9,7 +9,7 @@ describe('EpicsSelect', () => {
describe
(
'
store
'
,
()
=>
{
describe
(
'
store
'
,
()
=>
{
describe
(
'
getters
'
,
()
=>
{
describe
(
'
getters
'
,
()
=>
{
let
state
;
let
state
;
const
normalizedEpics
=
mockEpics
.
map
(
rawEpic
=>
const
normalizedEpics
=
mockEpics
.
map
(
(
rawEpic
)
=>
convertObjectPropsToCamelCase
(
Object
.
assign
(
rawEpic
,
{
url
:
rawEpic
.
web_edit_url
}),
{
convertObjectPropsToCamelCase
(
Object
.
assign
(
rawEpic
,
{
url
:
rawEpic
.
web_edit_url
}),
{
dropKeys
:
[
'
web_edit_url
'
],
dropKeys
:
[
'
web_edit_url
'
],
}),
}),
...
...
ee/spec/frontend/vue_shared/dashboards/store/actions_spec.js
View file @
39bb37cc
...
@@ -120,7 +120,7 @@ describe('actions', () => {
...
@@ -120,7 +120,7 @@ describe('actions', () => {
const
errorMessage
=
const
errorMessage
=
'
This dashboard is available for public projects, and private projects in groups with a Silver plan.
'
;
'
This dashboard is available for public projects, and private projects in groups with a Silver plan.
'
;
const
selectProjects
=
count
=>
{
const
selectProjects
=
(
count
)
=>
{
for
(
let
i
=
0
;
i
<
count
;
i
+=
1
)
{
for
(
let
i
=
0
;
i
<
count
;
i
+=
1
)
{
store
.
dispatch
(
'
toggleSelectedProject
'
,
{
store
.
dispatch
(
'
toggleSelectedProject
'
,
{
id
:
i
,
id
:
i
,
...
@@ -128,7 +128,7 @@ describe('actions', () => {
...
@@ -128,7 +128,7 @@ describe('actions', () => {
});
});
}
}
};
};
const
addInvalidProjects
=
invalid
=>
const
addInvalidProjects
=
(
invalid
)
=>
store
.
dispatch
(
'
receiveAddProjectsToDashboardSuccess
'
,
{
store
.
dispatch
(
'
receiveAddProjectsToDashboardSuccess
'
,
{
added
:
[],
added
:
[],
invalid
,
invalid
,
...
@@ -318,7 +318,7 @@ describe('actions', () => {
...
@@ -318,7 +318,7 @@ describe('actions', () => {
const
searchQueries
=
[
null
,
undefined
,
false
,
NaN
];
const
searchQueries
=
[
null
,
undefined
,
false
,
NaN
];
return
Promise
.
all
(
return
Promise
.
all
(
searchQueries
.
map
(
searchQuery
=>
{
searchQueries
.
map
(
(
searchQuery
)
=>
{
store
.
state
.
searchQuery
=
searchQuery
;
store
.
state
.
searchQuery
=
searchQuery
;
return
testAction
(
return
testAction
(
...
...
ee/spec/frontend/vue_shared/dashboards/store/mutations_spec.js
View file @
39bb37cc
...
@@ -12,7 +12,7 @@ describe('mutations', () => {
...
@@ -12,7 +12,7 @@ describe('mutations', () => {
useLocalStorageSpy
();
useLocalStorageSpy
();
const
projects
=
mockProjectData
(
3
);
const
projects
=
mockProjectData
(
3
);
const
projectIds
=
projects
.
map
(
p
=>
p
.
id
);
const
projectIds
=
projects
.
map
(
(
p
)
=>
p
.
id
);
const
mockEndpoint
=
'
https://mock-endpoint
'
;
const
mockEndpoint
=
'
https://mock-endpoint
'
;
let
localState
;
let
localState
;
...
@@ -135,7 +135,7 @@ describe('mutations', () => {
...
@@ -135,7 +135,7 @@ describe('mutations', () => {
});
});
it
(
'
orders the projects from localstorage
'
,
()
=>
{
it
(
'
orders the projects from localstorage
'
,
()
=>
{
jest
.
spyOn
(
window
.
localStorage
,
'
getItem
'
).
mockImplementation
(
key
=>
{
jest
.
spyOn
(
window
.
localStorage
,
'
getItem
'
).
mockImplementation
(
(
key
)
=>
{
if
(
key
===
projectListEndpoint
)
{
if
(
key
===
projectListEndpoint
)
{
return
'
2,0,1
'
;
return
'
2,0,1
'
;
}
}
...
@@ -149,7 +149,7 @@ describe('mutations', () => {
...
@@ -149,7 +149,7 @@ describe('mutations', () => {
});
});
it
(
'
places unsorted projects after sorted ones
'
,
()
=>
{
it
(
'
places unsorted projects after sorted ones
'
,
()
=>
{
jest
.
spyOn
(
window
.
localStorage
,
'
getItem
'
).
mockImplementation
(
key
=>
{
jest
.
spyOn
(
window
.
localStorage
,
'
getItem
'
).
mockImplementation
(
(
key
)
=>
{
if
(
key
===
projectListEndpoint
)
{
if
(
key
===
projectListEndpoint
)
{
return
'
1,2
'
;
return
'
1,2
'
;
}
}
...
...
ee/spec/frontend/vue_shared/discover/card_security_discover_app_spec.js
View file @
39bb37cc
...
@@ -5,7 +5,7 @@ import { mockTracking } from 'helpers/tracking_helper';
...
@@ -5,7 +5,7 @@ import { mockTracking } from 'helpers/tracking_helper';
describe
(
'
Card security discover app
'
,
()
=>
{
describe
(
'
Card security discover app
'
,
()
=>
{
let
wrapper
;
let
wrapper
;
const
createComponent
=
propsData
=>
{
const
createComponent
=
(
propsData
)
=>
{
wrapper
=
shallowMount
(
CardSecurityDiscoverApp
,
{
wrapper
=
shallowMount
(
CardSecurityDiscoverApp
,
{
propsData
,
propsData
,
});
});
...
...
ee/spec/frontend/vue_shared/license_compliance/components/add_license_form_dropdown_spec.js
View file @
39bb37cc
...
@@ -46,7 +46,7 @@ describe('AddLicenseFormDropdown', () => {
...
@@ -46,7 +46,7 @@ describe('AddLicenseFormDropdown', () => {
expect
(
vm
.
$el
.
value
).
toContain
(
value
);
expect
(
vm
.
$el
.
value
).
toContain
(
value
);
});
});
it
(
'
shows all defined licenses
'
,
async
done
=>
{
it
(
'
shows all defined licenses
'
,
async
(
done
)
=>
{
await
createComponent
();
await
createComponent
();
const
element
=
$
(
vm
.
$el
);
const
element
=
$
(
vm
.
$el
);
...
...
ee/spec/frontend/vue_shared/license_compliance/components/admin_license_management_row_spec.js
View file @
39bb37cc
...
@@ -23,8 +23,8 @@ describe('AdminLicenseManagementRow', () => {
...
@@ -23,8 +23,8 @@ describe('AdminLicenseManagementRow', () => {
vm
=
mountComponentWithStore
(
Component
,
{
props
,
store
});
vm
=
mountComponentWithStore
(
Component
,
{
props
,
store
});
};
};
const
findNthDropdown
=
num
=>
[...
vm
.
$el
.
querySelectorAll
(
'
.dropdown-item
'
)][
num
];
const
findNthDropdown
=
(
num
)
=>
[...
vm
.
$el
.
querySelectorAll
(
'
.dropdown-item
'
)][
num
];
const
findNthDropdownIcon
=
num
=>
findNthDropdown
(
num
).
querySelector
(
'
svg
'
);
const
findNthDropdownIcon
=
(
num
)
=>
findNthDropdown
(
num
).
querySelector
(
'
svg
'
);
const
findLoadingIcon
=
()
=>
vm
.
$el
.
querySelector
(
'
.js-loading-icon
'
);
const
findLoadingIcon
=
()
=>
vm
.
$el
.
querySelector
(
'
.js-loading-icon
'
);
const
findDropdownToggle
=
()
=>
vm
.
$el
.
querySelector
(
'
.dropdown > button
'
);
const
findDropdownToggle
=
()
=>
vm
.
$el
.
querySelector
(
'
.dropdown > button
'
);
const
findRemoveButton
=
()
=>
vm
.
$el
.
querySelector
(
'
.js-remove-button
'
);
const
findRemoveButton
=
()
=>
vm
.
$el
.
querySelector
(
'
.js-remove-button
'
);
...
@@ -54,7 +54,7 @@ describe('AdminLicenseManagementRow', () => {
...
@@ -54,7 +54,7 @@ describe('AdminLicenseManagementRow', () => {
});
});
describe
(
'
approved license
'
,
()
=>
{
describe
(
'
approved license
'
,
()
=>
{
beforeEach
(
done
=>
{
beforeEach
(
(
done
)
=>
{
vm
.
license
=
{
...
approvedLicense
,
approvalStatus
:
LICENSE_APPROVAL_STATUS
.
ALLOWED
};
vm
.
license
=
{
...
approvedLicense
,
approvalStatus
:
LICENSE_APPROVAL_STATUS
.
ALLOWED
};
Vue
.
nextTick
(
done
);
Vue
.
nextTick
(
done
);
});
});
...
@@ -89,7 +89,7 @@ describe('AdminLicenseManagementRow', () => {
...
@@ -89,7 +89,7 @@ describe('AdminLicenseManagementRow', () => {
});
});
describe
(
'
blacklisted license
'
,
()
=>
{
describe
(
'
blacklisted license
'
,
()
=>
{
beforeEach
(
done
=>
{
beforeEach
(
(
done
)
=>
{
vm
.
license
=
{
...
approvedLicense
,
approvalStatus
:
LICENSE_APPROVAL_STATUS
.
DENIED
};
vm
.
license
=
{
...
approvedLicense
,
approvalStatus
:
LICENSE_APPROVAL_STATUS
.
DENIED
};
Vue
.
nextTick
(
done
);
Vue
.
nextTick
(
done
);
});
});
...
...
ee/spec/frontend/vue_shared/license_compliance/components/delete_confirmation_modal_spec.js
View file @
39bb37cc
...
@@ -32,7 +32,7 @@ describe('DeleteConfirmationModal', () => {
...
@@ -32,7 +32,7 @@ describe('DeleteConfirmationModal', () => {
});
});
};
};
const
createComponent
=
initialState
=>
{
const
createComponent
=
(
initialState
)
=>
{
store
=
createStore
(
initialState
);
store
=
createStore
(
initialState
);
wrapper
=
shallowMount
(
Component
,
{
wrapper
=
shallowMount
(
Component
,
{
...
...
ee/spec/frontend/vue_shared/license_compliance/components/license_packages_spec.js
View file @
39bb37cc
...
@@ -29,7 +29,7 @@ describe('LicensePackages', () => {
...
@@ -29,7 +29,7 @@ describe('LicensePackages', () => {
expect
(
vm
.
remainingPackages
).
toBe
(
'
2 more
'
);
expect
(
vm
.
remainingPackages
).
toBe
(
'
2 more
'
);
});
});
it
(
'
returns empty string when count of packages does not exceed `displayPackageCount` prop
'
,
done
=>
{
it
(
'
returns empty string when count of packages does not exceed `displayPackageCount` prop
'
,
(
done
)
=>
{
vm
.
displayPackageCount
=
examplePackages
.
length
+
1
;
vm
.
displayPackageCount
=
examplePackages
.
length
+
1
;
Vue
.
nextTick
()
Vue
.
nextTick
()
.
then
(()
=>
{
.
then
(()
=>
{
...
...
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