diff --git a/cypress/utils/table.js b/cypress/utils/table.js index d484befb5..3f3b96d75 100644 --- a/cypress/utils/table.js +++ b/cypress/utils/table.js @@ -40,21 +40,26 @@ export const itHasNoActiveFilter = () => { }; export const itExportsDataToFile = (jsonData, filenamePrefix) => { - it.skip('exports data to JSON and CSV files', () => { + it('exports data to JSON and CSV files', () => { cy.clock(Date.now()); - cy.get('.pf-v5-c-toolbar__content-section > :nth-child(2) > .pf-v5-c-menu-toggle').click(); - cy.get('[data-ouia-component-id=Export] .pf-v5-c-dropdown__menu-item').should( + // the toggle of the export dropdown has aria-label of "Export" + // the actual dropdown has ouiaId of "Export" + + cy.get('[aria-label=Export]').click(); + + cy.get('[data-ouia-component-id=Export] .pf-v5-c-menu__item').should( 'have.length', 3 ); - cy.get('[data-ouia-component-id=Export] .pf-v5-c-dropdown__menu-item') + + cy.get('[data-ouia-component-id=Export] .pf-v5-c-menu__item') .contains('Export to JSON') .click(); - cy.get('[data-ouia-component-id=Export] button').click(); + cy.get('[aria-label=Export]').click(); - cy.get('[data-ouia-component-id=Export] .pf-v5-c-dropdown__menu-item') + cy.get('[data-ouia-component-id=Export] .pf-v5-c-menu__item') .contains('Export to CSV') .click(); diff --git a/src/Components/PresentationalComponents/CVEDetailsPageDescription/CVEDetailsPageDescription.test.js b/src/Components/PresentationalComponents/CVEDetailsPageDescription/CVEDetailsPageDescription.test.js index dcb5e9d8a..77499a931 100644 --- a/src/Components/PresentationalComponents/CVEDetailsPageDescription/CVEDetailsPageDescription.test.js +++ b/src/Components/PresentationalComponents/CVEDetailsPageDescription/CVEDetailsPageDescription.test.js @@ -2,6 +2,7 @@ import React from 'react'; import CVEDetailsPageDescription from './CVEDetailsPageDescription'; import { render } from '@testing-library/react'; import { IntlProvider } from '@redhat-cloud-services/frontend-components-translations'; +import { CVEPageContext } from '../../SmartComponents/CVEDetailsPage/CVEDetailsPage'; describe('CVEDetailsPageDescription component', () => { const cveAttributes = { @@ -22,10 +23,12 @@ describe('CVEDetailsPageDescription component', () => { systems_status_detail: { 0: 2 } }; - it.skip('should render without props', () => { + it('should render without props', () => { const { asFragment } = render( - + + + ); diff --git a/src/Components/PresentationalComponents/CVEDetailsPageDescription/__snapshots__/CVEDetailsPageDescription.test.js.snap b/src/Components/PresentationalComponents/CVEDetailsPageDescription/__snapshots__/CVEDetailsPageDescription.test.js.snap index 2be89a200..88001eee8 100644 --- a/src/Components/PresentationalComponents/CVEDetailsPageDescription/__snapshots__/CVEDetailsPageDescription.test.js.snap +++ b/src/Components/PresentationalComponents/CVEDetailsPageDescription/__snapshots__/CVEDetailsPageDescription.test.js.snap @@ -1,228 +1,51 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`CVEDetailsPageDescription component should render without props 1`] = ` - - +
-
- -
- -
- -
- Publish date - : -
-
- -
- - - -
- -
-
-
-
-
-
-
-
-
-
- -
- - - -
- -
-
-
-
-
-
- +
-
- For most up-to-date information, -
- + 12 May 2020 +
-
- - +
+
+
+

+ It was found that ghostscript could leak sensitive operators on the operand stack when a pseudo-operator pushes a subroutine. A specially crafted PostScript file could use this flaw to escape the -dSAFER protection in order to, for example, have access to the file system and execute commands. +

+
+
+
+ For most up-to-date information, +
+ + `; diff --git a/src/Components/PresentationalComponents/CVEDetailsPageSidebar/CVEDetailsPageSidebar.test.js b/src/Components/PresentationalComponents/CVEDetailsPageSidebar/CVEDetailsPageSidebar.test.js index 81f112760..f08bb2266 100644 --- a/src/Components/PresentationalComponents/CVEDetailsPageSidebar/CVEDetailsPageSidebar.test.js +++ b/src/Components/PresentationalComponents/CVEDetailsPageSidebar/CVEDetailsPageSidebar.test.js @@ -2,6 +2,7 @@ import React from 'react'; import CVEDetailsPageSidebar from './CVEDetailsPageSidebar'; import { render } from '@testing-library/react'; import { IntlProvider } from '@redhat-cloud-services/frontend-components-translations'; +import { CVEPageContext } from '../../SmartComponents/CVEDetailsPage/CVEDetailsPage'; const cveAttributes = { business_risk: "Low", @@ -26,10 +27,12 @@ const cveAttributes = { } describe('CVEDetailsPageSidebar component', () => { - it.skip('should render correctly', () => { + it('should render correctly', () => { const { asFragment } = render( - + + + ); expect(asFragment()).toMatchSnapshot(); diff --git a/src/Components/PresentationalComponents/CVEDetailsPageSidebar/__snapshots__/CVEDetailsPageSidebar.test.js.snap b/src/Components/PresentationalComponents/CVEDetailsPageSidebar/__snapshots__/CVEDetailsPageSidebar.test.js.snap index d2a179521..d360b460e 100644 --- a/src/Components/PresentationalComponents/CVEDetailsPageSidebar/__snapshots__/CVEDetailsPageSidebar.test.js.snap +++ b/src/Components/PresentationalComponents/CVEDetailsPageSidebar/__snapshots__/CVEDetailsPageSidebar.test.js.snap @@ -1,1285 +1,196 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`CVEDetailsPageSidebar component should render correctly 1`] = ` - - +
- +
-
- -
+ - - - - - - m - - - } - title="Business risk" - value={ - - Low - - } - > - - - - - - m - - - } - headerContent="" - id="popover" - position="bottom" - > - - - - - - - - - - - - m - - - - - - } - popperMatchesTriggerWidth={false} - positionModifiers={ - { - "bottom": "pf-m-bottom", - "bottom-end": "pf-m-bottom-right", - "bottom-start": "pf-m-bottom-left", - "left": "pf-m-left", - "left-end": "pf-m-left-bottom", - "left-start": "pf-m-left-top", - "right": "pf-m-right", - "right-end": "pf-m-right-bottom", - "right-start": "pf-m-right-top", - "top": "pf-m-top", - "top-end": "pf-m-top-right", - "top-start": "pf-m-top-left", - } - } - removeFindDomNode={false} - trigger={ - - - - - - - - Low - - - - - } - zIndex={9999} - > - - -
- -
- -
-
- - - -
-
-
-
-
-
-
-
- +
+
-
+ Low + +
+
+
+
+
+
+
+
+ - - - - Resolved - - -- - - - -
-
- - - - -
-
- - } - title="Status" - value={ - - - - - Resolved - - - } - > - - - - Resolved - - -- - - - -
-
- - - - -
-
- - } - headerContent="" - id="popover" - position="bottom" + Status +
+
+ - + + + + + Resolved + + +
- +
- - +
+ +
+ + Severity + + + +
+ + + + + + + + + Important + +
+
+
+
+
+
- - - - - - - - + + + +
- - -
- - - -
- - - - -
- - } - enableFlip={true} - headerContent="CVSS 3.0 vector breakdown" - id="popover-cvss" - maxWidth="100%" - position="bottom" - > - - - - - - CVSS 3.0 vector breakdown - - - - - - -
-
-
-
- - } - popperMatchesTriggerWidth={false} - positionModifiers={ - { - "bottom": "pf-m-bottom", - "bottom-end": "pf-m-bottom-right", - "bottom-start": "pf-m-bottom-left", - "left": "pf-m-left", - "left-end": "pf-m-left-bottom", - "left-start": "pf-m-left-top", - "right": "pf-m-right", - "right-end": "pf-m-right-bottom", - "right-start": "pf-m-right-top", - "top": "pf-m-top", - "top-end": "pf-m-top-right", - "top-start": "pf-m-top-left", - } - } - removeFindDomNode={false} - trigger={ - - } - zIndex={9999} - > - - - -
-
- - - -
- -
-
-
-
-
-
-
-
-
-
+ 7.8 + + + Vector: AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H + +
-
-
+ + `; diff --git a/src/Components/PresentationalComponents/Kebab/KebabItems.js b/src/Components/PresentationalComponents/Kebab/KebabItems.js index e5553dc34..7d1a39d8c 100644 --- a/src/Components/PresentationalComponents/Kebab/KebabItems.js +++ b/src/Components/PresentationalComponents/Kebab/KebabItems.js @@ -16,13 +16,13 @@ export const kebabItemDownloadPDF = (loading, downloadReport, props = {}) => ( ); export const kebabItemEditBusinessRisk = (showBusinessRiskModal, cves, props = {}) => ( - showBusinessRiskModal(cves)} {...props}> + showBusinessRiskModal(cves)} {...props}> ); export const kebabItemEditStatus = (showStatusModal, cves, inventoryIds, props = {}) => ( - showStatusModal(cves, inventoryIds)} {...props}> + showStatusModal(cves, inventoryIds)} {...props}> ); diff --git a/src/Components/PresentationalComponents/Kebab/__snapshots__/KebabItems.test.js.snap b/src/Components/PresentationalComponents/Kebab/__snapshots__/KebabItems.test.js.snap index 73b7aa45e..4568aef6d 100644 --- a/src/Components/PresentationalComponents/Kebab/__snapshots__/KebabItems.test.js.snap +++ b/src/Components/PresentationalComponents/Kebab/__snapshots__/KebabItems.test.js.snap @@ -48,7 +48,7 @@ exports[`KebabItems component Should render without default params 1`] = ` >
  • { it('shows buttons to edit status or business risk', () => { cy.get('.ins-c-primary-toolbar__actions > .pf-v5-c-menu-toggle').click(); - cy.get('[data-ouia-component-id="OUIA-Generated-DropdownItem-1"] > .pf-v5-c-menu__item') + cy.get('[data-ouia-component-id="edit-business-risk"] > .pf-v5-c-menu__item') .contains('Edit business risk') .should('exist'); - cy.get('[data-ouia-component-id="OUIA-Generated-DropdownItem-2"] > .pf-v5-c-menu__item') + cy.get('[data-ouia-component-id="edit-status"] > .pf-v5-c-menu__item') .contains('Edit status') .should('exist'); }); - it.skip('shows row actions', () => { - cy.get('[data-ouia-component-id="OUIA-Generated-TableRow-613"] > .pf-v5-c-table__action > .pf-v5-c-menu-toggle') + it('shows row actions', () => { + cy.get('.pf-v5-c-table__action > .pf-v5-c-menu-toggle') .should('exist'); }); diff --git a/src/Components/SmartComponents/CVEs/CVEsTableToolbar.js b/src/Components/SmartComponents/CVEs/CVEsTableToolbar.js index c2a1ce40f..680955935 100644 --- a/src/Components/SmartComponents/CVEs/CVEsTableToolbar.js +++ b/src/Components/SmartComponents/CVEs/CVEsTableToolbar.js @@ -96,7 +96,7 @@ const CVEsTableToolbarWithContext = ({ context, canEditStatusOrBusinessRisk, can business_risk_id: attributes ? attributes.business_risk_id : business_risk_id, justification: attributes ? attributes.business_risk_text : business_risk_text })), true), - props: { isDisabled: !selectedCvesCount } + props: { isDisabled: !selectedCvesCount, ouiaId: 'edit-business-risk' } }, { label: intl.formatMessage(messages.editStatus), @@ -112,7 +112,7 @@ const CVEsTableToolbarWithContext = ({ context, canEditStatusOrBusinessRisk, can justification: attributes ? attributes.status_text : status_justification, status_id: attributes ? attributes.status_id : status_id }), []), true), - props: { isDisabled: !selectedCvesCount } + props: { isDisabled: !selectedCvesCount, ouiaId: 'edit-status' } } ] : [], {