From ce0bccf1f2a11aa39bcc37926bf8ee67813d6ae2 Mon Sep 17 00:00:00 2001 From: Jorge Miguel Lobo Escalona <47326048+jloboescalona2@users.noreply.github.com> Date: Thu, 9 Dec 2021 18:37:52 +0100 Subject: [PATCH] F #5422: Add flags data-cy (#1656) (cherry picked from commit 26b15d5d098453c458b337be67d378e3a3874985) --- .../client/components/Dialogs/DialogConfirmation.js | 4 ++++ .../src/client/components/Dialogs/DialogForm.js | 1 - .../src/client/components/Forms/FormWithSchema.js | 2 +- .../AttachDiskForm/ImageSteps/AdvancedOptions/index.js | 6 +----- .../Vm/AttachDiskForm/ImageSteps/ImagesTable/index.js | 1 + .../VolatileSteps/AdvancedOptions/index.js | 6 +----- .../VolatileSteps/BasicConfiguration/index.js | 6 +----- .../Steps/ExtraConfiguration/booting/index.js | 2 +- .../ExtraConfiguration/context/configurationSection.js | 6 +++--- .../Steps/ExtraConfiguration/context/filesSection.js | 2 +- .../ExtraConfiguration/context/userInputsSection.js | 2 +- .../Steps/ExtraConfiguration/inputOutput/index.js | 2 +- .../ExtraConfiguration/inputOutput/inputsSection.js | 2 +- .../inputOutput/pciDevicesSection.js | 2 +- .../Steps/ExtraConfiguration/networking/index.js | 4 ++-- .../CreateForm/Steps/ExtraConfiguration/numa/index.js | 4 ++-- .../Steps/ExtraConfiguration/placement/index.js | 2 +- .../Steps/ExtraConfiguration/scheduleAction.js | 10 ++++++++-- .../Steps/ExtraConfiguration/storage/index.js | 10 +++++----- .../Forms/VmTemplate/CreateForm/Steps/General/index.js | 4 ++-- .../client/components/Sidebar/SidebarCollapseItem.js | 3 ++- src/fireedge/src/client/components/Status/Chip.js | 2 +- .../components/Tables/Enhanced/Utils/GlobalFilter.js | 6 ++++-- .../src/client/components/Tables/Enhanced/filters.js | 5 ++++- .../src/client/components/Tables/Enhanced/index.js | 5 +++++ .../src/client/components/Tables/Images/row.js | 6 ++++-- .../src/client/components/Tables/VNetworks/row.js | 2 +- .../src/client/components/Tabs/Vm/Storage/Item.js | 6 +++++- .../src/client/components/Tabs/Vm/Storage/index.js | 4 ++-- src/fireedge/src/client/components/Tabs/Vm/index.js | 1 + src/fireedge/src/client/components/Tabs/index.js | 4 ++-- 31 files changed, 69 insertions(+), 53 deletions(-) diff --git a/src/fireedge/src/client/components/Dialogs/DialogConfirmation.js b/src/fireedge/src/client/components/Dialogs/DialogConfirmation.js index c27f6415b7..d594d38d82 100644 --- a/src/fireedge/src/client/components/Dialogs/DialogConfirmation.js +++ b/src/fireedge/src/client/components/Dialogs/DialogConfirmation.js @@ -44,6 +44,7 @@ import { T } from 'client/constants' * @property {object} [cancelButtonProps] - Cancel button properties * @property {boolean} [fixedWidth] - Fix minimum with to dialog * @property {boolean} [fixedHeight] - Fix minimum height to dialog + * @property {object} [dataCy] - identifier for cypress tests * @property {JSXElementConstructor} [children] - Fix minimum height */ @@ -65,6 +66,7 @@ const DialogConfirmation = memo( fixedWidth, fixedHeight, children, + dataCy, }) => { const isMobile = useMediaQuery((theme) => theme.breakpoints.only('xs')) @@ -85,6 +87,7 @@ const DialogConfirmation = memo( TransitionProps={{ onEntering: handleEntering, }} + {...(dataCy && { 'data-cy': dataCy })} > { const classes = useStyles() - const { className, ...contentProps } = dialogProps.contentProps ?? {} dialogProps.contentProps = { diff --git a/src/fireedge/src/client/components/Forms/FormWithSchema.js b/src/fireedge/src/client/components/Forms/FormWithSchema.js index b33be5e97e..b673f6d30c 100644 --- a/src/fireedge/src/client/components/Forms/FormWithSchema.js +++ b/src/fireedge/src/client/components/Forms/FormWithSchema.js @@ -110,7 +110,7 @@ const FormWithSchema = ({ return { ...field, [key]: finalValue } }, {}) - const dataCy = `${cy}-${name}` + const dataCy = `${cy}-${name}`.replaceAll('.', '-') const inputName = addIdToName(name) const isHidden = htmlType === INPUT_TYPES.HIDDEN diff --git a/src/fireedge/src/client/components/Forms/Vm/AttachDiskForm/ImageSteps/AdvancedOptions/index.js b/src/fireedge/src/client/components/Forms/Vm/AttachDiskForm/ImageSteps/AdvancedOptions/index.js index e62a9e4eb3..f6275d02d7 100644 --- a/src/fireedge/src/client/components/Forms/Vm/AttachDiskForm/ImageSteps/AdvancedOptions/index.js +++ b/src/fireedge/src/client/components/Forms/Vm/AttachDiskForm/ImageSteps/AdvancedOptions/index.js @@ -26,11 +26,7 @@ import { T } from 'client/constants' export const STEP_ID = 'advanced' const Content = ({ hypervisor }) => ( - + ) const AdvancedOptions = ({ hypervisor } = {}) => ({ diff --git a/src/fireedge/src/client/components/Forms/Vm/AttachDiskForm/ImageSteps/ImagesTable/index.js b/src/fireedge/src/client/components/Forms/Vm/AttachDiskForm/ImageSteps/ImagesTable/index.js index 737cb85fde..55d2b387b7 100644 --- a/src/fireedge/src/client/components/Forms/Vm/AttachDiskForm/ImageSteps/ImagesTable/index.js +++ b/src/fireedge/src/client/components/Forms/Vm/AttachDiskForm/ImageSteps/ImagesTable/index.js @@ -44,6 +44,7 @@ const Content = ({ data, setFormData }) => { onlyGlobalSelectedRows initialState={{ selectedRowIds: { [ID]: true } }} onSelectedRowsChange={handleSelectedRows} + searchProps={{ 'data-cy': 'search-images' }} /> ) } diff --git a/src/fireedge/src/client/components/Forms/Vm/AttachDiskForm/VolatileSteps/AdvancedOptions/index.js b/src/fireedge/src/client/components/Forms/Vm/AttachDiskForm/VolatileSteps/AdvancedOptions/index.js index bd2cbb7085..f83a22c766 100644 --- a/src/fireedge/src/client/components/Forms/Vm/AttachDiskForm/VolatileSteps/AdvancedOptions/index.js +++ b/src/fireedge/src/client/components/Forms/Vm/AttachDiskForm/VolatileSteps/AdvancedOptions/index.js @@ -26,11 +26,7 @@ import { T } from 'client/constants' export const STEP_ID = 'advanced' const Content = ({ hypervisor }) => ( - + ) const AdvancedOptions = ({ hypervisor } = {}) => ({ diff --git a/src/fireedge/src/client/components/Forms/Vm/AttachDiskForm/VolatileSteps/BasicConfiguration/index.js b/src/fireedge/src/client/components/Forms/Vm/AttachDiskForm/VolatileSteps/BasicConfiguration/index.js index 3d2a52f7a0..ffaa17afe9 100644 --- a/src/fireedge/src/client/components/Forms/Vm/AttachDiskForm/VolatileSteps/BasicConfiguration/index.js +++ b/src/fireedge/src/client/components/Forms/Vm/AttachDiskForm/VolatileSteps/BasicConfiguration/index.js @@ -26,11 +26,7 @@ import { T } from 'client/constants' export const STEP_ID = 'configuration' const Content = ({ hypervisor }) => ( - + ) const BasicConfiguration = ({ hypervisor } = {}) => ({ diff --git a/src/fireedge/src/client/components/Forms/VmTemplate/CreateForm/Steps/ExtraConfiguration/booting/index.js b/src/fireedge/src/client/components/Forms/VmTemplate/CreateForm/Steps/ExtraConfiguration/booting/index.js index 41456ad378..c09a5b1012 100644 --- a/src/fireedge/src/client/components/Forms/VmTemplate/CreateForm/Steps/ExtraConfiguration/booting/index.js +++ b/src/fireedge/src/client/components/Forms/VmTemplate/CreateForm/Steps/ExtraConfiguration/booting/index.js @@ -60,7 +60,7 @@ const Booting = ({ hypervisor, ...props }) => { ))} diff --git a/src/fireedge/src/client/components/Forms/VmTemplate/CreateForm/Steps/ExtraConfiguration/context/configurationSection.js b/src/fireedge/src/client/components/Forms/VmTemplate/CreateForm/Steps/ExtraConfiguration/context/configurationSection.js index d74b3472d3..ace6f06dc3 100644 --- a/src/fireedge/src/client/components/Forms/VmTemplate/CreateForm/Steps/ExtraConfiguration/context/configurationSection.js +++ b/src/fireedge/src/client/components/Forms/VmTemplate/CreateForm/Steps/ExtraConfiguration/context/configurationSection.js @@ -51,13 +51,13 @@ const ConfigurationSection = () => { sx={{ gridTemplateColumns: { sm: '1fr', md: '1fr 1fr' } }} >
@@ -71,7 +71,7 @@ const ConfigurationSection = () => {
( FILES_FIELDS(hypervisor)} id={EXTRA_ID} diff --git a/src/fireedge/src/client/components/Forms/VmTemplate/CreateForm/Steps/ExtraConfiguration/context/userInputsSection.js b/src/fireedge/src/client/components/Forms/VmTemplate/CreateForm/Steps/ExtraConfiguration/context/userInputsSection.js index 7a0b8ddb38..5011b0f437 100644 --- a/src/fireedge/src/client/components/Forms/VmTemplate/CreateForm/Steps/ExtraConfiguration/context/userInputsSection.js +++ b/src/fireedge/src/client/components/Forms/VmTemplate/CreateForm/Steps/ExtraConfiguration/context/userInputsSection.js @@ -157,7 +157,7 @@ const UserInputsSection = () => { onSubmit={methods.handleSubmit(onSubmit)} > diff --git a/src/fireedge/src/client/components/Forms/VmTemplate/CreateForm/Steps/ExtraConfiguration/inputOutput/index.js b/src/fireedge/src/client/components/Forms/VmTemplate/CreateForm/Steps/ExtraConfiguration/inputOutput/index.js index 940a434604..bd4fc115c3 100644 --- a/src/fireedge/src/client/components/Forms/VmTemplate/CreateForm/Steps/ExtraConfiguration/inputOutput/index.js +++ b/src/fireedge/src/client/components/Forms/VmTemplate/CreateForm/Steps/ExtraConfiguration/inputOutput/index.js @@ -42,7 +42,7 @@ const InputOutput = ({ hypervisor }) => { sx={{ gridTemplateColumns: { sm: '1fr', md: '1fr 1fr' } }} > { onSubmit={methods.handleSubmit(onSubmit)} > diff --git a/src/fireedge/src/client/components/Forms/VmTemplate/CreateForm/Steps/ExtraConfiguration/inputOutput/pciDevicesSection.js b/src/fireedge/src/client/components/Forms/VmTemplate/CreateForm/Steps/ExtraConfiguration/inputOutput/pciDevicesSection.js index e7bdec359a..ddc7c5b30a 100644 --- a/src/fireedge/src/client/components/Forms/VmTemplate/CreateForm/Steps/ExtraConfiguration/inputOutput/pciDevicesSection.js +++ b/src/fireedge/src/client/components/Forms/VmTemplate/CreateForm/Steps/ExtraConfiguration/inputOutput/pciDevicesSection.js @@ -79,7 +79,7 @@ const PciDevicesSection = ({ fields }) => { onSubmit={methods.handleSubmit(onSubmit)} > diff --git a/src/fireedge/src/client/components/Forms/VmTemplate/CreateForm/Steps/ExtraConfiguration/networking/index.js b/src/fireedge/src/client/components/Forms/VmTemplate/CreateForm/Steps/ExtraConfiguration/networking/index.js index 0fb38befca..7a2364ed8e 100644 --- a/src/fireedge/src/client/components/Forms/VmTemplate/CreateForm/Steps/ExtraConfiguration/networking/index.js +++ b/src/fireedge/src/client/components/Forms/VmTemplate/CreateForm/Steps/ExtraConfiguration/networking/index.js @@ -80,7 +80,7 @@ const Networking = () => { }} options={[ { - dialogProps: { title: T.AttachNic }, + dialogProps: { title: T.AttachNic, dataCy: 'modal-attach-nic' }, form: () => AttachNicForm({ nics }), onSubmit: (nic) => append(mapNameFunction(nic, nics.length)), }, @@ -109,7 +109,7 @@ const Networking = () => { ))} ( <> diff --git a/src/fireedge/src/client/components/Forms/VmTemplate/CreateForm/Steps/ExtraConfiguration/placement/index.js b/src/fireedge/src/client/components/Forms/VmTemplate/CreateForm/Steps/ExtraConfiguration/placement/index.js index b97745bc24..1965984b17 100644 --- a/src/fireedge/src/client/components/Forms/VmTemplate/CreateForm/Steps/ExtraConfiguration/placement/index.js +++ b/src/fireedge/src/client/components/Forms/VmTemplate/CreateForm/Steps/ExtraConfiguration/placement/index.js @@ -40,7 +40,7 @@ const Placement = () => ( ))} diff --git a/src/fireedge/src/client/components/Forms/VmTemplate/CreateForm/Steps/ExtraConfiguration/scheduleAction.js b/src/fireedge/src/client/components/Forms/VmTemplate/CreateForm/Steps/ExtraConfiguration/scheduleAction.js index 3862155472..f19e3bdfb2 100644 --- a/src/fireedge/src/client/components/Forms/VmTemplate/CreateForm/Steps/ExtraConfiguration/scheduleAction.js +++ b/src/fireedge/src/client/components/Forms/VmTemplate/CreateForm/Steps/ExtraConfiguration/scheduleAction.js @@ -58,7 +58,10 @@ const ScheduleAction = () => { { cy: 'add-sched-action-punctual', name: 'Punctual action', - dialogProps: { title: T.ScheduledAction }, + dialogProps: { + title: T.ScheduledAction, + dataCy: 'modal-sched-actions', + }, form: () => PunctualForm(), onSubmit: (action) => append(mapNameFunction(action, scheduleActions.length)), @@ -66,7 +69,10 @@ const ScheduleAction = () => { { cy: 'add-sched-action-relative', name: 'Relative action', - dialogProps: { title: T.ScheduledAction }, + dialogProps: { + title: T.ScheduledAction, + dataCy: 'modal-sched-actions', + }, form: () => RelativeForm(), onSubmit: (action) => append(mapNameFunction(action, scheduleActions.length)), diff --git a/src/fireedge/src/client/components/Forms/VmTemplate/CreateForm/Steps/ExtraConfiguration/storage/index.js b/src/fireedge/src/client/components/Forms/VmTemplate/CreateForm/Steps/ExtraConfiguration/storage/index.js index 289a9760e4..24b0ea157b 100644 --- a/src/fireedge/src/client/components/Forms/VmTemplate/CreateForm/Steps/ExtraConfiguration/storage/index.js +++ b/src/fireedge/src/client/components/Forms/VmTemplate/CreateForm/Steps/ExtraConfiguration/storage/index.js @@ -80,16 +80,16 @@ const Storage = ({ hypervisor }) => { }} options={[ { - cy: 'attach-image-disk', + cy: 'attach-image', name: T.Image, - dialogProps: { title: T.AttachImage }, + dialogProps: { title: T.AttachImage, dataCy: 'modal-attach-image' }, form: () => ImageSteps({ hypervisor }), onSubmit: (image) => append(mapNameFunction(image, disks.length)), }, { - cy: 'attach-volatile-disk', + cy: 'attach-volatile', name: T.Volatile, - dialogProps: { title: T.AttachVolatile }, + dialogProps: { title: T.AttachVolatile, dataCy: 'modal-attach-volatile' }, form: () => VolatileSteps({ hypervisor }), onSubmit: (image) => append(mapNameFunction(image, disks.length)), }, @@ -117,7 +117,7 @@ const Storage = ({ hypervisor }) => { ))} { return (
{ key={id} id={STEP_ID} className={classes[id]} - cy={`${STEP_ID}.${id}`} + cy={`${STEP_ID}-${id}`} {...section} /> ))} diff --git a/src/fireedge/src/client/components/Sidebar/SidebarCollapseItem.js b/src/fireedge/src/client/components/Sidebar/SidebarCollapseItem.js index 5125e70f26..9f04719bd7 100644 --- a/src/fireedge/src/client/components/Sidebar/SidebarCollapseItem.js +++ b/src/fireedge/src/client/components/Sidebar/SidebarCollapseItem.js @@ -60,8 +60,9 @@ const SidebarCollapseItem = ({ label = '', routes = [], icon: Icon }) => { )} {expanded ? : } diff --git a/src/fireedge/src/client/components/Status/Chip.js b/src/fireedge/src/client/components/Status/Chip.js index ee173b69d2..a7e093489d 100644 --- a/src/fireedge/src/client/components/Status/Chip.js +++ b/src/fireedge/src/client/components/Status/Chip.js @@ -100,7 +100,7 @@ const StatusChip = memo( component="span" className={classes.text} onClick={callAll(onClick, clipboard && handleCopy)} - data-cy={dataCy} + {...(dataCy && { 'data-cy': dataCy })} {...props} > {text} diff --git a/src/fireedge/src/client/components/Tables/Enhanced/Utils/GlobalFilter.js b/src/fireedge/src/client/components/Tables/Enhanced/Utils/GlobalFilter.js index 613e8d048c..f6470ba248 100644 --- a/src/fireedge/src/client/components/Tables/Enhanced/Utils/GlobalFilter.js +++ b/src/fireedge/src/client/components/Tables/Enhanced/Utils/GlobalFilter.js @@ -63,10 +63,11 @@ const useStyles = makeStyles(({ spacing, palette, shape, breakpoints }) => ({ * * @param {object} props - Props * @param {string} props.className - Class to wrapper root + * @param {object} props.searchProps - Props for search input * @param {UseGlobalFiltersInstanceProps} props.useTableProps - Table props * @returns {JSXElementConstructor} Component JSX */ -const GlobalFilter = ({ useTableProps, className }) => { +const GlobalFilter = ({ useTableProps, className, searchProps }) => { const classes = useStyles() const { setGlobalFilter, state } = useTableProps @@ -100,7 +101,7 @@ const GlobalFilter = ({ useTableProps, className }) => { root: classes.inputRoot, input: classes.inputInput, }} - inputProps={{ 'aria-label': 'search' }} + inputProps={{ 'aria-label': 'search', ...(searchProps ?? {}) }} />
) @@ -109,6 +110,7 @@ const GlobalFilter = ({ useTableProps, className }) => { GlobalFilter.propTypes = { className: PropTypes.string, useTableProps: PropTypes.object.isRequired, + searchProps: PropTypes.object, } export default GlobalFilter diff --git a/src/fireedge/src/client/components/Tables/Enhanced/filters.js b/src/fireedge/src/client/components/Tables/Enhanced/filters.js index 61e50f37b5..ad7c848f64 100644 --- a/src/fireedge/src/client/components/Tables/Enhanced/filters.js +++ b/src/fireedge/src/client/components/Tables/Enhanced/filters.js @@ -50,10 +50,11 @@ const useToolbarStyles = makeStyles({ /** * @param {object} props - Props * @param {boolean} props.onlyGlobalSearch - Show only the global search + * @param {object} props.searchProps - Props for search input * @param {UseTableInstanceProps} props.useTableProps - Table props * @returns {JSXElementConstructor} Returns table toolbar */ -const Filters = ({ onlyGlobalSearch, useTableProps }) => { +const Filters = ({ onlyGlobalSearch, useTableProps, searchProps }) => { const classes = useToolbarStyles() const isMobile = useMediaQuery((theme) => theme.breakpoints.down('md')) @@ -77,6 +78,7 @@ const Filters = ({ onlyGlobalSearch, useTableProps }) => { ) } @@ -104,6 +106,7 @@ const Filters = ({ onlyGlobalSearch, useTableProps }) => { Filters.propTypes = { onlyGlobalSearch: PropTypes.bool, useTableProps: PropTypes.object, + searchProps: PropTypes.object, } Filters.defaultProps = { diff --git a/src/fireedge/src/client/components/Tables/Enhanced/index.js b/src/fireedge/src/client/components/Tables/Enhanced/index.js index 11c38bfea0..fd491f3d91 100644 --- a/src/fireedge/src/client/components/Tables/Enhanced/index.js +++ b/src/fireedge/src/client/components/Tables/Enhanced/index.js @@ -60,6 +60,7 @@ const EnhancedTable = ({ singleSelect = false, classes = {}, rootProps = {}, + searchProps = {}, }) => { const styles = EnhancedTableStyles() @@ -183,6 +184,7 @@ const EnhancedTable = ({ )} @@ -245,6 +247,9 @@ export const EnhancedTableProps = { rootProps: PropTypes.shape({ 'data-cy': PropTypes.string, }), + searchProps: PropTypes.shape({ + 'data-cy': PropTypes.string, + }), isLoading: PropTypes.bool, onlyGlobalSearch: PropTypes.bool, onlyGlobalSelectedRows: PropTypes.bool, diff --git a/src/fireedge/src/client/components/Tables/Images/row.js b/src/fireedge/src/client/components/Tables/Images/row.js index cca86eea1e..515e193117 100644 --- a/src/fireedge/src/client/components/Tables/Images/row.js +++ b/src/fireedge/src/client/components/Tables/Images/row.js @@ -52,13 +52,15 @@ const Row = ({ original, value, ...props }) => { const timeAgo = `registered ${time.toRelative()}` return ( -
+
- {NAME} + + {NAME} + {LOCK && } {labels.map((label) => ( diff --git a/src/fireedge/src/client/components/Tables/VNetworks/row.js b/src/fireedge/src/client/components/Tables/VNetworks/row.js index f45bca1682..1e416e50ea 100644 --- a/src/fireedge/src/client/components/Tables/VNetworks/row.js +++ b/src/fireedge/src/client/components/Tables/VNetworks/row.js @@ -42,7 +42,7 @@ const Row = ({ original, value, ...props }) => { VirtualNetworkModel.getLeasesInfo(original) return ( -
+
{NAME} diff --git a/src/fireedge/src/client/components/Tabs/Vm/Storage/Item.js b/src/fireedge/src/client/components/Tabs/Vm/Storage/Item.js index 875d2cc467..e357e3556e 100644 --- a/src/fireedge/src/client/components/Tabs/Vm/Storage/Item.js +++ b/src/fireedge/src/client/components/Tabs/Vm/Storage/Item.js @@ -98,7 +98,11 @@ const StorageItem = ({ disk, actions = [] }) => { {labels.map(({ label, dataCy }) => ( - + ))}
diff --git a/src/fireedge/src/client/components/Tabs/Vm/Storage/index.js b/src/fireedge/src/client/components/Tabs/Vm/Storage/index.js index 4bc6a3d61f..22eb535e18 100644 --- a/src/fireedge/src/client/components/Tabs/Vm/Storage/index.js +++ b/src/fireedge/src/client/components/Tabs/Vm/Storage/index.js @@ -65,14 +65,14 @@ const VmStorageTab = ({ tabProps: { actions } = {} }) => { }} options={[ { - cy: 'attach-image-disk', + cy: 'attach-image', name: T.Image, dialogProps: { title: T.AttachImage }, form: () => ImageSteps({ hypervisor }), onSubmit: handleAttachDisk, }, { - cy: 'attach-volatile-disk', + cy: 'attach-volatile', name: T.Volatile, dialogProps: { title: T.AttachVolatile }, form: () => VolatileSteps({ hypervisor }), diff --git a/src/fireedge/src/client/components/Tabs/Vm/index.js b/src/fireedge/src/client/components/Tabs/Vm/index.js index dfcf2b7745..c89dc0a95a 100644 --- a/src/fireedge/src/client/components/Tabs/Vm/index.js +++ b/src/fireedge/src/client/components/Tabs/Vm/index.js @@ -80,6 +80,7 @@ const VmTabs = memo(({ id }) => { return ( TabContent && { name: camelName, + id: tabName, renderContent: (props) => TabContent({ ...props, tabProps }), } ) diff --git a/src/fireedge/src/client/components/Tabs/index.js b/src/fireedge/src/client/components/Tabs/index.js index 91ed445c19..907ab30988 100644 --- a/src/fireedge/src/client/components/Tabs/index.js +++ b/src/fireedge/src/client/components/Tabs/index.js @@ -73,14 +73,14 @@ const Tabs = ({ }} {...tabsProps} > - {tabs.map(({ value, name, label, error, icon: Icon }, idx) => ( + {tabs.map(({ id, value, name, label, error, icon: Icon }, idx) => ( : Icon && } value={value ?? idx} label={label ?? name} - data-cy={`tab-${name}`} + data-cy={`tab-${id}`} /> ))}