1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-21 14:50:08 +03:00

M #~: Add data-cy selector to testing (#2064)

This commit is contained in:
Sergio Betanzos 2022-05-19 14:01:05 +02:00 committed by GitHub
parent d91510862e
commit cebaac8477
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 2 deletions

View File

@ -114,6 +114,7 @@ const FormWithSchema = ({
<LegendWrapper>
{legend && (
<Legend
data-cy={`legend-${cy}`}
title={legend}
tooltip={legendTooltip}
disableGutters={accordion}

View File

@ -39,8 +39,8 @@ const StyledLegend = styled((props) => (
)
const Legend = memo(
({ title, tooltip, disableGutters }) => (
<StyledLegend ownerState={{ tooltip, disableGutters }}>
({ 'data-cy': dataCy, title, tooltip, disableGutters }) => (
<StyledLegend data-cy={dataCy} ownerState={{ tooltip, disableGutters }}>
<Translate word={title} />
{!!tooltip && <AdornmentWithTooltip title={tooltip} />}
</StyledLegend>
@ -49,6 +49,7 @@ const Legend = memo(
)
Legend.propTypes = {
'data-cy': PropTypes.string,
title: PropTypes.any,
tooltip: PropTypes.string,
disableGutters: PropTypes.bool,

View File

@ -81,6 +81,7 @@ const ContextVarsSection = ({ hypervisor }) => {
<AccordionSummary>
<Legend
disableGutters
data-cy={'context-custom-vars'}
title={T.ContextCustomVariables}
tooltip={T.ContextCustomVariablesConcept}
/>