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
920afc5c
Commit
920afc5c
authored
Jan 20, 2022
by
Illya Klymov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace usage of find/findAll in misc ee components (3/5)
* migrate to proper use of findComponent/findAllComponents
parent
68755b38
Changes
20
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
79 additions
and
77 deletions
+79
-77
ee/spec/frontend/issuable/components/related_issuable_item_spec.js
...rontend/issuable/components/related_issuable_item_spec.js
+1
-1
ee/spec/frontend/issuable/related_issues/components/related_issues_list_spec.js
...ble/related_issues/components/related_issues_list_spec.js
+1
-1
ee/spec/frontend/issues/show/components/incidents/incident_sla_spec.js
...end/issues/show/components/incidents/incident_sla_spec.js
+1
-1
ee/spec/frontend/issues/show/components/incidents/metrics_image_spec.js
...nd/issues/show/components/incidents/metrics_image_spec.js
+2
-2
ee/spec/frontend/issues/show/components/incidents/metrics_tab_spec.js
...tend/issues/show/components/incidents/metrics_tab_spec.js
+6
-6
ee/spec/frontend/issues_analytics/components/issues_analytics_spec.js
...tend/issues_analytics/components/issues_analytics_spec.js
+3
-3
ee/spec/frontend/issues_analytics/components/issues_analytics_table_spec.js
...ssues_analytics/components/issues_analytics_table_spec.js
+2
-2
ee/spec/frontend/jobs/shared_runner_limit_block_spec.js
ee/spec/frontend/jobs/shared_runner_limit_block_spec.js
+1
-1
ee/spec/frontend/license_compliance/components/app_spec.js
ee/spec/frontend/license_compliance/components/app_spec.js
+20
-20
ee/spec/frontend/license_compliance/components/detected_licenses_table_spec.js
...nse_compliance/components/detected_licenses_table_spec.js
+2
-2
ee/spec/frontend/license_compliance/components/license_component_links_spec.js
...nse_compliance/components/license_component_links_spec.js
+10
-10
ee/spec/frontend/license_compliance/components/licenses_table_row_spec.js
.../license_compliance/components/licenses_table_row_spec.js
+10
-10
ee/spec/frontend/license_compliance/components/licenses_table_spec.js
...tend/license_compliance/components/licenses_table_spec.js
+1
-1
ee/spec/frontend/maintenance_mode_settings/components/app_spec.js
...frontend/maintenance_mode_settings/components/app_spec.js
+4
-4
ee/spec/frontend/notes/components/note_header_spec.js
ee/spec/frontend/notes/components/note_header_spec.js
+1
-1
ee/spec/frontend/on_demand_scans/components/empty_state_spec.js
...c/frontend/on_demand_scans/components/empty_state_spec.js
+1
-1
ee/spec/frontend/on_demand_scans/components/tabs/scheduled_spec.js
...rontend/on_demand_scans/components/tabs/scheduled_spec.js
+1
-1
ee/spec/frontend/on_demand_scans_form/components/on_demand_scans_form_spec.js
...demand_scans_form/components/on_demand_scans_form_spec.js
+4
-4
ee/spec/frontend/on_demand_scans_form/components/profile_selector/dast_profiles_selector_spec.js
...omponents/profile_selector/dast_profiles_selector_spec.js
+6
-4
ee/spec/frontend/on_demand_scans_form/components/profile_selector/profile_selector_spec.js
...form/components/profile_selector/profile_selector_spec.js
+2
-2
No files found.
ee/spec/frontend/issuable/components/related_issuable_item_spec.js
View file @
920afc5c
...
...
@@ -47,6 +47,6 @@ describe('RelatedIssuableItem', () => {
});
it
(
'
renders weight component with correct weight
'
,
()
=>
{
expect
(
wrapper
.
find
(
IssueWeight
).
props
(
'
weight
'
)).
toBe
(
props
.
weight
);
expect
(
wrapper
.
find
Component
(
IssueWeight
).
props
(
'
weight
'
)).
toBe
(
props
.
weight
);
});
});
ee/spec/frontend/issuable/related_issues/components/related_issues_list_spec.js
View file @
920afc5c
...
...
@@ -29,7 +29,7 @@ describe('RelatedIssuesList', () => {
});
it
(
'
shows weight
'
,
()
=>
{
expect
(
wrapper
.
find
(
IssueWeight
).
find
(
'
.board-card-info-text
'
).
text
()).
toBe
(
expect
(
wrapper
.
find
Component
(
IssueWeight
).
find
(
'
.board-card-info-text
'
).
text
()).
toBe
(
issuable1
.
weight
.
toString
(),
);
});
...
...
ee/spec/frontend/issues/show/components/incidents/incident_sla_spec.js
View file @
920afc5c
...
...
@@ -33,7 +33,7 @@ describe('Incident SLA', () => {
}
});
const
findSLA
=
()
=>
wrapper
.
find
(
ServiceLevelAgreement
);
const
findSLA
=
()
=>
wrapper
.
find
Component
(
ServiceLevelAgreement
);
it
(
'
renders a blank component when there is no data
'
,
()
=>
{
mountComponent
({
...
...
ee/spec/frontend/issues/show/components/incidents/metrics_image_spec.js
View file @
920afc5c
...
...
@@ -47,10 +47,10 @@ describe('Metrics upload item', () => {
}
});
const
findImageLink
=
()
=>
wrapper
.
find
(
GlLink
);
const
findImageLink
=
()
=>
wrapper
.
find
Component
(
GlLink
);
const
findCollapseButton
=
()
=>
wrapper
.
find
(
'
[data-testid="collapse-button"]
'
);
const
findMetricImageBody
=
()
=>
wrapper
.
find
(
'
[data-testid="metric-image-body"]
'
);
const
findModal
=
()
=>
wrapper
.
find
(
GlModal
);
const
findModal
=
()
=>
wrapper
.
find
Component
(
GlModal
);
const
findDeleteButton
=
()
=>
wrapper
.
find
(
'
[data-testid="delete-button"]
'
);
const
closeModal
=
()
=>
findModal
().
vm
.
$emit
(
'
hidden
'
);
...
...
ee/spec/frontend/issues/show/components/incidents/metrics_tab_spec.js
View file @
920afc5c
...
...
@@ -54,9 +54,9 @@ describe('Metrics tab', () => {
}
});
const
findUploadDropzone
=
()
=>
wrapper
.
find
(
UploadDropzone
);
const
findImages
=
()
=>
wrapper
.
findAll
(
MetricsImage
);
const
findModal
=
()
=>
wrapper
.
find
(
GlModal
);
const
findUploadDropzone
=
()
=>
wrapper
.
find
Component
(
UploadDropzone
);
const
findImages
=
()
=>
wrapper
.
findAll
Components
(
MetricsImage
);
const
findModal
=
()
=>
wrapper
.
find
Component
(
GlModal
);
const
submitModal
=
()
=>
findModal
().
vm
.
$emit
(
'
primary
'
,
mockEvent
);
const
cancelModal
=
()
=>
findModal
().
vm
.
$emit
(
'
hidden
'
);
...
...
@@ -145,7 +145,7 @@ describe('Metrics tab', () => {
});
it
(
'
should display the url field
'
,
()
=>
{
expect
(
wrapper
.
find
(
GlFormInput
).
attributes
(
'
value
'
)).
toBe
(
testUrl
);
expect
(
wrapper
.
find
Component
(
GlFormInput
).
attributes
(
'
value
'
)).
toBe
(
testUrl
);
});
it
(
'
should clear url when cancelled
'
,
async
()
=>
{
...
...
@@ -153,7 +153,7 @@ describe('Metrics tab', () => {
await
waitForPromises
();
expect
(
wrapper
.
find
(
GlFormInput
).
attributes
(
'
value
'
)).
toBe
(
''
);
expect
(
wrapper
.
find
Component
(
GlFormInput
).
attributes
(
'
value
'
)).
toBe
(
''
);
});
it
(
'
should clear url when submitted
'
,
async
()
=>
{
...
...
@@ -161,7 +161,7 @@ describe('Metrics tab', () => {
await
waitForPromises
();
expect
(
wrapper
.
find
(
GlFormInput
).
attributes
(
'
value
'
)).
toBe
(
''
);
expect
(
wrapper
.
find
Component
(
GlFormInput
).
attributes
(
'
value
'
)).
toBe
(
''
);
});
});
});
...
...
ee/spec/frontend/issues_analytics/components/issues_analytics_spec.js
View file @
920afc5c
...
...
@@ -59,9 +59,9 @@ describe('Issue Analytics component', () => {
axiosMock
.
restore
();
});
const
findLoadingIcon
=
()
=>
wrapper
.
find
(
GlLoadingIcon
);
const
findLoadingIcon
=
()
=>
wrapper
.
find
Component
(
GlLoadingIcon
);
const
findChartContainer
=
()
=>
wrapper
.
find
(
'
.issues-analytics-chart
'
);
const
findEmptyState
=
()
=>
wrapper
.
find
(
GlEmptyState
);
const
findEmptyState
=
()
=>
wrapper
.
find
Component
(
GlEmptyState
);
it
(
'
fetches chart data when mounted
'
,
()
=>
{
expect
(
store
.
dispatch
).
toHaveBeenCalledWith
(
'
issueAnalytics/fetchChartData
'
,
TEST_HOST
);
...
...
@@ -113,6 +113,6 @@ describe('Issue Analytics component', () => {
});
it
(
'
renders the issues table
'
,
()
=>
{
expect
(
wrapper
.
find
(
IssuesAnalyticsTable
).
exists
()).
toBe
(
true
);
expect
(
wrapper
.
find
Component
(
IssuesAnalyticsTable
).
exists
()).
toBe
(
true
);
});
});
ee/spec/frontend/issues_analytics/components/issues_analytics_table_spec.js
View file @
920afc5c
...
...
@@ -54,7 +54,7 @@ describe('IssuesAnalyticsTable', () => {
});
it
(
'
displays a loading icon
'
,
()
=>
{
expect
(
wrapper
.
find
(
GlLoadingIcon
).
exists
()).
toBe
(
true
);
expect
(
wrapper
.
find
Component
(
GlLoadingIcon
).
exists
()).
toBe
(
true
);
});
it
(
'
does not display the table
'
,
()
=>
{
...
...
@@ -64,7 +64,7 @@ describe('IssuesAnalyticsTable', () => {
describe
(
'
fetching data completed
'
,
()
=>
{
it
(
'
hides the loading state
'
,
()
=>
{
expect
(
wrapper
.
find
(
GlLoadingIcon
).
exists
()).
toBe
(
false
);
expect
(
wrapper
.
find
Component
(
GlLoadingIcon
).
exists
()).
toBe
(
false
);
});
it
(
'
displays the table
'
,
()
=>
{
...
...
ee/spec/frontend/jobs/shared_runner_limit_block_spec.js
View file @
920afc5c
...
...
@@ -39,7 +39,7 @@ describe('Shared Runner Limit Block', () => {
});
it
(
'
renders call to action gl-button with the right href
'
,
()
=>
{
const
glButton
=
wrapper
.
find
(
GlButton
);
const
glButton
=
wrapper
.
find
Component
(
GlButton
);
expect
(
glButton
.
isVisible
()).
toBe
(
true
);
expect
(
glButton
.
attributes
(
'
variant
'
)).
toBe
(
'
danger
'
);
...
...
ee/spec/frontend/license_compliance/components/app_spec.js
View file @
920afc5c
...
...
@@ -114,24 +114,24 @@ describe('Project Licenses', () => {
});
it
(
'
shows the loading component
'
,
()
=>
{
expect
(
wrapper
.
find
(
GlLoadingIcon
).
exists
()).
toBe
(
true
);
expect
(
wrapper
.
find
Component
(
GlLoadingIcon
).
exists
()).
toBe
(
true
);
});
it
(
'
does not show the empty state component
'
,
()
=>
{
expect
(
wrapper
.
find
(
GlEmptyState
).
exists
()).
toBe
(
false
);
expect
(
wrapper
.
find
Component
(
GlEmptyState
).
exists
()).
toBe
(
false
);
});
it
(
'
does not show the list of detected in project licenses
'
,
()
=>
{
expect
(
wrapper
.
find
(
DetectedLicensesTable
).
exists
()).
toBe
(
false
);
expect
(
wrapper
.
find
Component
(
DetectedLicensesTable
).
exists
()).
toBe
(
false
);
});
it
(
'
does not show the list of license policies
'
,
()
=>
{
expect
(
wrapper
.
find
(
LicenseManagement
).
exists
()).
toBe
(
false
);
expect
(
wrapper
.
find
Component
(
LicenseManagement
).
exists
()).
toBe
(
false
);
});
it
(
'
does not render any tabs
'
,
()
=>
{
expect
(
wrapper
.
find
(
GlTabs
).
exists
()).
toBe
(
false
);
expect
(
wrapper
.
find
(
GlTab
).
exists
()).
toBe
(
false
);
expect
(
wrapper
.
find
Component
(
GlTabs
).
exists
()).
toBe
(
false
);
expect
(
wrapper
.
find
Component
(
GlTab
).
exists
()).
toBe
(
false
);
});
});
...
...
@@ -150,24 +150,24 @@ describe('Project Licenses', () => {
});
it
(
'
shows the empty state component
'
,
()
=>
{
expect
(
wrapper
.
find
(
GlEmptyState
).
exists
()).
toBe
(
true
);
expect
(
wrapper
.
find
Component
(
GlEmptyState
).
exists
()).
toBe
(
true
);
});
it
(
'
does not show the loading component
'
,
()
=>
{
expect
(
wrapper
.
find
(
GlLoadingIcon
).
exists
()).
toBe
(
false
);
expect
(
wrapper
.
find
Component
(
GlLoadingIcon
).
exists
()).
toBe
(
false
);
});
it
(
'
does not show the list of detected in project licenses
'
,
()
=>
{
expect
(
wrapper
.
find
(
DetectedLicensesTable
).
exists
()).
toBe
(
false
);
expect
(
wrapper
.
find
Component
(
DetectedLicensesTable
).
exists
()).
toBe
(
false
);
});
it
(
'
does not show the list of license policies
'
,
()
=>
{
expect
(
wrapper
.
find
(
LicenseManagement
).
exists
()).
toBe
(
false
);
expect
(
wrapper
.
find
Component
(
LicenseManagement
).
exists
()).
toBe
(
false
);
});
it
(
'
does not render any tabs
'
,
()
=>
{
expect
(
wrapper
.
find
(
GlTabs
).
exists
()).
toBe
(
false
);
expect
(
wrapper
.
find
(
GlTab
).
exists
()).
toBe
(
false
);
expect
(
wrapper
.
find
Component
(
GlTabs
).
exists
()).
toBe
(
false
);
expect
(
wrapper
.
find
Component
(
GlTab
).
exists
()).
toBe
(
false
);
});
});
...
...
@@ -186,7 +186,7 @@ describe('Project Licenses', () => {
});
it
(
'
does not render a policy violations alert
'
,
()
=>
{
expect
(
wrapper
.
find
(
GlAlert
).
exists
()).
toBe
(
false
);
expect
(
wrapper
.
find
Component
(
GlAlert
).
exists
()).
toBe
(
false
);
});
it
(
'
renders the SbomBannercomponent with the right props
'
,
()
=>
{
...
...
@@ -196,21 +196,21 @@ describe('Project Licenses', () => {
});
it
(
'
renders a "Detected in project" tab and a "Policies" tab
'
,
()
=>
{
expect
(
wrapper
.
find
(
GlTabs
).
exists
()).
toBe
(
true
);
expect
(
wrapper
.
find
(
GlTab
).
exists
()).
toBe
(
true
);
expect
(
wrapper
.
find
Component
(
GlTabs
).
exists
()).
toBe
(
true
);
expect
(
wrapper
.
find
Component
(
GlTab
).
exists
()).
toBe
(
true
);
expect
(
wrapper
.
findAllComponents
(
GlTab
)).
toHaveLength
(
2
);
});
it
(
'
it renders the "Detected in project" table
'
,
()
=>
{
expect
(
wrapper
.
find
(
DetectedLicensesTable
).
exists
()).
toBe
(
true
);
expect
(
wrapper
.
find
Component
(
DetectedLicensesTable
).
exists
()).
toBe
(
true
);
});
it
(
'
it renders the "Policies" table
'
,
()
=>
{
expect
(
wrapper
.
find
(
LicenseManagement
).
exists
()).
toBe
(
true
);
expect
(
wrapper
.
find
Component
(
LicenseManagement
).
exists
()).
toBe
(
true
);
});
it
(
'
renders the pipeline info
'
,
()
=>
{
expect
(
wrapper
.
find
(
PipelineInfo
).
exists
()).
toBe
(
true
);
expect
(
wrapper
.
find
Component
(
PipelineInfo
).
exists
()).
toBe
(
true
);
});
describe
.
each
`
...
...
@@ -329,8 +329,8 @@ describe('Project Licenses', () => {
});
it
(
'
renders a policy violations alert
'
,
()
=>
{
expect
(
wrapper
.
find
(
GlAlert
).
exists
()).
toBe
(
true
);
expect
(
wrapper
.
find
(
GlAlert
).
text
()).
toContain
(
expect
(
wrapper
.
find
Component
(
GlAlert
).
exists
()).
toBe
(
true
);
expect
(
wrapper
.
find
Component
(
GlAlert
).
text
()).
toContain
(
"
Detected licenses that are out-of-compliance with the project's assigned policies
"
,
);
});
...
...
ee/spec/frontend/license_compliance/components/detected_licenses_table_spec.js
View file @
920afc5c
...
...
@@ -24,7 +24,7 @@ describe('DetectedLicenesTable component', () => {
};
const
expectComponentWithProps
=
(
Component
,
props
=
{})
=>
{
const
componentWrapper
=
wrapper
.
find
(
Component
);
const
componentWrapper
=
wrapper
.
find
Component
(
Component
);
expect
(
componentWrapper
.
isVisible
()).
toBe
(
true
);
expect
(
componentWrapper
.
props
()).
toEqual
(
expect
.
objectContaining
(
props
));
};
...
...
@@ -102,7 +102,7 @@ describe('DetectedLicenesTable component', () => {
});
it
(
'
does not render pagination
'
,
()
=>
{
expect
(
wrapper
.
find
(
Pagination
).
exists
()).
toBe
(
false
);
expect
(
wrapper
.
find
Component
(
Pagination
).
exists
()).
toBe
(
false
);
});
});
});
ee/spec/frontend/license_compliance/components/license_component_links_spec.js
View file @
920afc5c
...
...
@@ -35,7 +35,7 @@ describe('LicenseComponentLinks component', () => {
// query helpers
const
findComponentsList
=
()
=>
wrapper
.
find
(
'
.js-component-links-component-list
'
);
const
findComponentListItems
=
()
=>
wrapper
.
findAll
(
'
.js-component-links-component-list-item
'
);
const
findModal
=
()
=>
wrapper
.
find
(
GlModal
);
const
findModal
=
()
=>
wrapper
.
find
Component
(
GlModal
);
const
findModalItem
=
()
=>
wrapper
.
findAll
(
'
.js-component-links-modal-item
'
);
const
findModalTrigger
=
()
=>
wrapper
.
find
(
'
.js-component-links-modal-trigger
'
);
...
...
@@ -55,7 +55,7 @@ describe('LicenseComponentLinks component', () => {
it
(
'
intersperses the list of licenses correctly
'
,
()
=>
{
factory
();
const
intersperseInstance
=
wrapper
.
find
(
GlIntersperse
);
const
intersperseInstance
=
wrapper
.
find
Component
(
GlIntersperse
);
expect
(
intersperseInstance
.
exists
()).
toBe
(
true
);
expect
(
intersperseInstance
.
attributes
(
'
lastseparator
'
)).
toBe
(
'
and
'
);
...
...
@@ -80,11 +80,11 @@ describe('LicenseComponentLinks component', () => {
({
numComponents
,
numComponentsWithUrl
,
expectedNumVisibleLinks
,
expectedNumModalLinks
})
=>
{
factory
({
numComponents
,
numComponentsWithUrl
});
expect
(
findComponentsList
().
findAll
(
GlLink
)).
toHaveLength
(
expectedNumVisibleLinks
);
expect
(
findComponentsList
().
findAll
Components
(
GlLink
)).
toHaveLength
(
expectedNumVisibleLinks
);
// findModal() is an empty wrapper if we have less than VISIBLE_COMPONENT_COUNT
if
(
numComponents
>
VISIBLE_COMPONENT_COUNT
)
{
expect
(
findModal
().
findAll
(
GlLink
)).
toHaveLength
(
expectedNumModalLinks
);
expect
(
findModal
().
findAll
Components
(
GlLink
)).
toHaveLength
(
expectedNumModalLinks
);
}
else
{
expect
(
findModal
().
exists
()).
toBe
(
false
);
}
...
...
@@ -94,7 +94,7 @@ describe('LicenseComponentLinks component', () => {
it
(
'
sets all links to open in new windows/tabs
'
,
()
=>
{
factory
({
numComponents
:
8
,
numComponentsWithUrl
:
8
});
const
links
=
wrapper
.
findAll
(
GlLink
);
const
links
=
wrapper
.
findAll
Components
(
GlLink
);
links
.
wrappers
.
forEach
((
link
)
=>
{
expect
(
link
.
attributes
(
'
target
'
)).
toBe
(
'
_blank
'
);
...
...
@@ -128,13 +128,13 @@ describe('LicenseComponentLinks component', () => {
({
numComponents
,
expectedNumModals
})
=>
{
factory
({
numComponents
,
expectedNumModals
});
expect
(
wrapper
.
findAll
(
GlModal
)).
toHaveLength
(
expectedNumModals
);
expect
(
wrapper
.
findAll
Components
(
GlModal
)).
toHaveLength
(
expectedNumModals
);
},
);
it
(
'
opens the modal when the trigger gets clicked
'
,
()
=>
{
factory
({
numComponents
:
3
});
const
modalId
=
wrapper
.
find
(
GlModal
).
props
(
'
modalId
'
);
const
modalId
=
wrapper
.
find
Component
(
GlModal
).
props
(
'
modalId
'
);
const
modalTrigger
=
findModalTrigger
();
const
rootEmit
=
jest
.
spyOn
(
wrapper
.
vm
.
$root
,
'
$emit
'
);
...
...
@@ -149,7 +149,7 @@ describe('LicenseComponentLinks component', () => {
while
(
usedModalIds
.
length
<
10
)
{
factory
({
numComponents
});
const
modalId
=
wrapper
.
find
(
GlModal
).
props
(
'
modalId
'
);
const
modalId
=
wrapper
.
find
Component
(
GlModal
).
props
(
'
modalId
'
);
expect
(
usedModalIds
).
not
.
toContain
(
modalId
);
usedModalIds
.
push
(
modalId
);
...
...
@@ -160,13 +160,13 @@ describe('LicenseComponentLinks component', () => {
const
title
=
'
test-component
'
;
factory
({
numComponents
:
3
,
title
});
expect
(
wrapper
.
find
(
GlModal
).
attributes
(
'
title
'
)).
toEqual
(
title
);
expect
(
wrapper
.
find
Component
(
GlModal
).
attributes
(
'
title
'
)).
toEqual
(
title
);
});
it
(
'
assigns the correct action button text to the modal
'
,
()
=>
{
factory
({
numComponents
:
3
});
expect
(
wrapper
.
find
(
GlModal
).
attributes
(
'
ok-title
'
)).
toEqual
(
'
Close
'
);
expect
(
wrapper
.
find
Component
(
GlModal
).
attributes
(
'
ok-title
'
)).
toEqual
(
'
Close
'
);
});
it
.
each
`
...
...
ee/spec/frontend/license_compliance/components/licenses_table_row_spec.js
View file @
920afc5c
...
...
@@ -20,7 +20,7 @@ describe('LicensesTableRow component', () => {
});
};
const
findLoading
=
()
=>
wrapper
.
find
(
GlSkeletonLoading
);
const
findLoading
=
()
=>
wrapper
.
find
Component
(
GlSkeletonLoading
);
const
findContent
=
()
=>
wrapper
.
find
(
'
.js-license-row
'
);
const
findNameSection
=
()
=>
findContent
().
find
(
'
.section-30
'
);
const
findComponentSection
=
()
=>
findContent
().
find
(
'
.section-70
'
);
...
...
@@ -66,7 +66,7 @@ describe('LicensesTableRow component', () => {
});
it
(
'
shows name
'
,
()
=>
{
const
nameLink
=
findNameSection
().
find
(
GlLink
);
const
nameLink
=
findNameSection
().
find
Component
(
GlLink
);
expect
(
nameLink
.
exists
()).
toBe
(
true
);
expect
(
nameLink
.
attributes
(
'
href
'
)).
toEqual
(
license
.
url
);
...
...
@@ -74,7 +74,7 @@ describe('LicensesTableRow component', () => {
});
it
(
'
shows components
'
,
()
=>
{
const
componentLinks
=
findComponentSection
().
find
(
LicenseComponentLinks
);
const
componentLinks
=
findComponentSection
().
find
Component
(
LicenseComponentLinks
);
expect
(
componentLinks
.
exists
()).
toBe
(
true
);
expect
(
componentLinks
.
props
()).
toEqual
(
...
...
@@ -100,9 +100,9 @@ describe('LicensesTableRow component', () => {
it
(
'
renders the GlFriendlyWrap and GlLink components
'
,
()
=>
{
const
nameSection
=
findNameSection
();
expect
(
nameSection
.
find
(
GlLink
).
exists
()).
toBe
(
true
);
expect
(
nameSection
.
find
(
GlFriendlyWrap
).
exists
()).
toBe
(
true
);
expect
(
nameSection
.
find
(
GlFriendlyWrap
).
attributes
().
text
).
toBe
(
license
.
name
);
expect
(
nameSection
.
find
Component
(
GlLink
).
exists
()).
toBe
(
true
);
expect
(
nameSection
.
find
Component
(
GlFriendlyWrap
).
exists
()).
toBe
(
true
);
expect
(
nameSection
.
find
Component
(
GlFriendlyWrap
).
attributes
().
text
).
toBe
(
license
.
name
);
});
});
...
...
@@ -120,7 +120,7 @@ describe('LicensesTableRow component', () => {
const
nameSection
=
findNameSection
();
expect
(
nameSection
.
text
()).
toContain
(
license
.
name
);
expect
(
nameSection
.
find
(
GlLink
).
exists
()).
toBe
(
false
);
expect
(
nameSection
.
find
Component
(
GlLink
).
exists
()).
toBe
(
false
);
});
});
...
...
@@ -135,8 +135,8 @@ describe('LicensesTableRow component', () => {
});
it
(
'
shows the policy violation badge
'
,
()
=>
{
expect
(
wrapper
.
find
(
GlBadge
).
exists
()).
toBe
(
true
);
expect
(
wrapper
.
find
(
GlBadge
).
text
()).
toContain
(
'
Policy violation: denied
'
);
expect
(
wrapper
.
find
Component
(
GlBadge
).
exists
()).
toBe
(
true
);
expect
(
wrapper
.
find
Component
(
GlBadge
).
text
()).
toContain
(
'
Policy violation: denied
'
);
});
});
...
...
@@ -151,7 +151,7 @@ describe('LicensesTableRow component', () => {
});
it
(
'
does not show the policy violation badge
'
,
()
=>
{
expect
(
wrapper
.
find
(
GlBadge
).
exists
()).
toBe
(
false
);
expect
(
wrapper
.
find
Component
(
GlBadge
).
exists
()).
toBe
(
false
);
});
});
});
ee/spec/frontend/license_compliance/components/licenses_table_spec.js
View file @
920afc5c
...
...
@@ -13,7 +13,7 @@ describe('LicensesTable component', () => {
};
const
findTableRowHeader
=
()
=>
wrapper
.
find
(
'
.table-row-header
'
);
const
findRows
=
()
=>
wrapper
.
findAll
(
LicensesTableRow
);
const
findRows
=
()
=>
wrapper
.
findAll
Components
(
LicensesTableRow
);
afterEach
(()
=>
{
wrapper
.
destroy
();
...
...
ee/spec/frontend/maintenance_mode_settings/components/app_spec.js
View file @
920afc5c
...
...
@@ -36,10 +36,10 @@ describe('MaintenanceModeSettingsApp', () => {
wrapper
=
null
;
});
const
findMaintenanceModeSettingsForm
=
()
=>
wrapper
.
find
(
GlForm
);
const
findGlLoadingIcon
=
()
=>
wrapper
.
find
(
GlLoadingIcon
);
const
findGlToggle
=
()
=>
wrapper
.
find
(
GlToggle
);
const
findGlFormTextarea
=
()
=>
wrapper
.
find
(
GlFormTextarea
);
const
findMaintenanceModeSettingsForm
=
()
=>
wrapper
.
find
Component
(
GlForm
);
const
findGlLoadingIcon
=
()
=>
wrapper
.
find
Component
(
GlLoadingIcon
);
const
findGlToggle
=
()
=>
wrapper
.
find
Component
(
GlToggle
);
const
findGlFormTextarea
=
()
=>
wrapper
.
find
Component
(
GlFormTextarea
);
const
findSubmitButton
=
()
=>
findMaintenanceModeSettingsForm
().
find
(
'
[type="submit"]
'
);
describe
(
'
template
'
,
()
=>
{
...
...
ee/spec/frontend/notes/components/note_header_spec.js
View file @
920afc5c
...
...
@@ -43,7 +43,7 @@ describe('NoteHeader component', () => {
// Wait for dynamic imports to resolve
return
new
Promise
(
setImmediate
).
then
(()
=>
{
expect
(
wrapper
.
find
(
GitlabTeamMemberBadge
).
exists
()).
toBe
(
expected
);
expect
(
wrapper
.
find
Component
(
GitlabTeamMemberBadge
).
exists
()).
toBe
(
expected
);
});
},
);
...
...
ee/spec/frontend/on_demand_scans/components/empty_state_spec.js
View file @
920afc5c
...
...
@@ -6,7 +6,7 @@ describe('EmptyState', () => {
let
wrapper
;
// Finders
const
findGlEmptyState
=
()
=>
wrapper
.
find
(
GlEmptyState
);
const
findGlEmptyState
=
()
=>
wrapper
.
find
Component
(
GlEmptyState
);
// Helpers
const
defaultGlEmptyStateProp
=
(
prop
)
=>
GlEmptyState
.
props
[
prop
].
default
;
...
...
ee/spec/frontend/on_demand_scans/components/tabs/scheduled_spec.js
View file @
920afc5c
...
...
@@ -134,7 +134,7 @@ describe('Scheduled tab', () => {
it
(
'
renders the schedule cell
'
,
()
=>
{
const
scheduleCell
=
findCellAt
(
5
);
const
dastScanScheduleComponent
=
scheduleCell
.
find
(
DastScanSchedule
);
const
dastScanScheduleComponent
=
scheduleCell
.
find
Component
(
DastScanSchedule
);
expect
(
dastScanScheduleComponent
.
exists
()).
toBe
(
true
);
expect
(
dastScanScheduleComponent
.
props
(
'
schedule
'
)).
toEqual
(
firstProfile
.
dastProfileSchedule
);
...
...
ee/spec/frontend/on_demand_scans_form/components/on_demand_scans_form_spec.js
View file @
920afc5c
...
...
@@ -70,7 +70,7 @@ describe('OnDemandScansForm', () => {
template
:
'
<input />
'
,
});
const
findForm
=
()
=>
wrapper
.
find
(
GlForm
);
const
findForm
=
()
=>
wrapper
.
find
Component
(
GlForm
);
const
findByTestId
=
(
testId
)
=>
wrapper
.
find
(
`[data-testid="
${
testId
}
"]`
);
const
findHelpPageLink
=
()
=>
findByTestId
(
'
help-page-link
'
);
const
findNameInput
=
()
=>
findByTestId
(
'
dast-scan-name-input
'
);
...
...
@@ -111,7 +111,7 @@ describe('OnDemandScansForm', () => {
return
setValidFormData
();
};
const
selectProfile
=
(
component
)
=>
async
(
profile
)
=>
{
wrapper
.
find
(
component
).
vm
.
$emit
(
'
input
'
,
profile
.
id
);
wrapper
.
find
Component
(
component
).
vm
.
$emit
(
'
input
'
,
profile
.
id
);
await
wrapper
.
vm
.
$nextTick
();
};
const
selectScannerProfile
=
selectProfile
(
ScannerProfileSelector
);
...
...
@@ -248,7 +248,7 @@ describe('OnDemandScansForm', () => {
},
});
expect
(
wrapper
.
find
(
GlSkeletonLoader
).
exists
()).
toBe
(
isLoading
);
expect
(
wrapper
.
find
Component
(
GlSkeletonLoader
).
exists
()).
toBe
(
isLoading
);
},
);
});
...
...
@@ -577,7 +577,7 @@ describe('OnDemandScansForm', () => {
});
it
(
'
automatically selects the only available profile
'
,
()
=>
{
expect
(
wrapper
.
find
(
selector
).
attributes
(
'
value
'
)).
toBe
(
profile
.
id
);
expect
(
wrapper
.
find
Component
(
selector
).
attributes
(
'
value
'
)).
toBe
(
profile
.
id
);
});
});
...
...
ee/spec/frontend/on_demand_scans_form/components/profile_selector/dast_profiles_selector_spec.js
View file @
920afc5c
...
...
@@ -126,7 +126,7 @@ describe('EE - DAST Profiles Selector', () => {
},
});
expect
(
wrapper
.
find
(
GlSkeletonLoader
).
exists
()).
toBe
(
isLoading
);
expect
(
wrapper
.
find
Component
(
GlSkeletonLoader
).
exists
()).
toBe
(
isLoading
);
},
);
});
...
...
@@ -179,7 +179,7 @@ describe('EE - DAST Profiles Selector', () => {
});
it
(
'
automatically selects the only available profile
'
,
()
=>
{
expect
(
wrapper
.
find
(
selector
).
attributes
(
'
value
'
)).
toBe
(
profile
.
id
);
expect
(
wrapper
.
find
Component
(
selector
).
attributes
(
'
value
'
)).
toBe
(
profile
.
id
);
});
});
...
...
@@ -209,8 +209,10 @@ describe('EE - DAST Profiles Selector', () => {
);
createComponent
();
expect
(
wrapper
.
find
(
SiteProfileSelector
).
attributes
(
'
value
'
)).
toBe
(
siteProfile
.
id
);
expect
(
wrapper
.
find
(
ScannerProfileSelector
).
attributes
(
'
value
'
)).
toBe
(
scannerProfile
.
id
);
expect
(
wrapper
.
findComponent
(
SiteProfileSelector
).
attributes
(
'
value
'
)).
toBe
(
siteProfile
.
id
);
expect
(
wrapper
.
findComponent
(
ScannerProfileSelector
).
attributes
(
'
value
'
)).
toBe
(
scannerProfile
.
id
,
);
});
});
});
ee/spec/frontend/on_demand_scans_form/components/profile_selector/profile_selector_spec.js
View file @
920afc5c
...
...
@@ -40,13 +40,13 @@ describe('OnDemandScansProfileSelector', () => {
// Helpers
const
parseDropdownItems
=
()
=>
findProfilesDropdown
()
.
findAll
(
GlDropdownItem
)
.
findAll
Components
(
GlDropdownItem
)
.
wrappers
.
map
((
x
)
=>
({
text
:
x
.
text
(),
isChecked
:
x
.
props
(
'
isChecked
'
),
}));
const
selectFirstProfile
=
()
=>
{
return
findProfilesDropdown
().
find
(
GlDropdownItem
).
vm
.
$emit
(
'
click
'
);
return
findProfilesDropdown
().
find
Component
(
GlDropdownItem
).
vm
.
$emit
(
'
click
'
);
};
const
createFullComponent
=
(
options
=
{})
=>
{
...
...
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