diff --git a/ee/spec/frontend/security_dashboard/components/shared/vulnerability_report/vulnerability_list_spec.js b/ee/spec/frontend/security_dashboard/components/shared/vulnerability_report/vulnerability_list_spec.js index cb576bd266d8b9a9e0a1681bdb0bb827992dbc6f..258334b14edd2722b690322bfe21c26f3a85a545 100644 --- a/ee/spec/frontend/security_dashboard/components/shared/vulnerability_report/vulnerability_list_spec.js +++ b/ee/spec/frontend/security_dashboard/components/shared/vulnerability_report/vulnerability_list_spec.js @@ -82,6 +82,7 @@ describe('Vulnerability list component', () => { const findDashboardHasNoVulnerabilities = () => wrapper.findComponent(DashboardHasNoVulnerabilities); const findVendorNames = () => wrapper.findByTestId('vulnerability-vendor'); + const findVulnerabilityCheckbox = () => wrapper.findByTestId('vulnerability-checkbox'); const findCheckAllCheckbox = () => wrapper.findByTestId('vulnerability-checkbox-all'); const findAllRowCheckboxes = () => wrapper.findAllByTestId('vulnerability-checkbox'); const findSkeletonLoading = () => wrapper.findAllComponents(GlSkeletonLoader); @@ -156,8 +157,7 @@ describe('Vulnerability list component', () => { }); it('should show the selection summary when a checkbox is selected', async () => { - findDataCell('vulnerability-checkbox').setChecked(true); - await nextTick(); + await findVulnerabilityCheckbox().trigger('change'); expect(findSelectionSummary().props('visible')).toBe(true); }); @@ -175,9 +175,7 @@ describe('Vulnerability list component', () => { }); it('should sync selected vulnerabilities when the vulnerability list is updated', async () => { - findDataCell('vulnerability-checkbox').setChecked(true); - - await nextTick(); + await findVulnerabilityCheckbox().trigger('change'); expect(findSelectionSummary().props('selectedVulnerabilities')).toHaveLength(1); @@ -189,8 +187,8 @@ describe('Vulnerability list component', () => { }); it('should uncheck a selected vulnerability after the vulnerability is updated', async () => { - const checkbox = () => findDataCell('vulnerability-checkbox'); - checkbox().setChecked(true); + const checkbox = () => findVulnerabilityCheckbox(); + await checkbox().trigger('change'); expect(checkbox().element.checked).toBe(true); await nextTick();