F #5626: Add data-cy (#1703)

This commit is contained in:
Jorge Miguel Lobo Escalona authored and GitHub committed 2022-01-18 11:41:59 +01:00
1 parent 5c8334e9f9
commit 05fa7e07ca
7 files changed
+14 -10

No files matched your search

@@ -38,7 +38,7 @@ const Row = ({ original, value, ...props }) => {
DatastoreModel.getState(original)
return (
<div {...props}>
<div {...props} data-cy={`datastore-${ID}`}>
<div>
<StatusCircle color={stateColor} tooltip={stateName} />
</div>
@@ -95,7 +95,7 @@ const Filters = ({ onlyGlobalSearch, useTableProps, searchProps }) => {
[classes.contentWithFilter]: !noFilters,
})}
>
<GlobalFilter useTableProps={useTableProps} />
<GlobalFilter useTableProps={useTableProps} searchProps={searchProps} />
{!noFilters && <div className={classes.filters}>{filters}</div>}
</CardContent>
@@ -26,7 +26,7 @@ const Row = ({ original, value, ...props }) => {
const { ID, NAME, TOTAL_USERS } = value
return (
<div {...props}>
<div {...props} data-cy={`group-${ID}`}>
<div className={classes.main}>
<div className={classes.title}>
<Typography component="span">{NAME}</Typography>
@@ -51,7 +51,7 @@ const Row = ({ original, value, ...props }) => {
const labels = [...new Set([IM_MAD, VM_MAD])]
return (
<div {...props}>
<div {...props} data-cy={`host-${ID}`}>
<div>
<StatusCircle color={stateColor} tooltip={stateName} />
</div>
@@ -26,7 +26,7 @@ const Row = ({ original, value, ...props }) => {
const { ID, NAME, GNAME, ENABLED, AUTH_DRIVER } = value
return (
<div {...props}>
<div {...props} data-cy={`user-${ID}`}>
<div className={classes.main}>
<div className={classes.title}>
<Typography component="span">{NAME}</Typography>
@@ -56,21 +56,23 @@ const Row = ({ original, value, ...props }) => {
<Typography noWrap component="span">
{NAME}
</Typography>
<span className={classes.labels}>{LOCK && <Lock />}</span>
<span className={classes.labels}>
{LOCK && <Lock data-cy="lock" />}
</span>
</div>
<div className={classes.caption}>
<span title={time.toFormat('ff')}>{`#${ID} ${timeAgo}`}</span>
<span title={`Owner: ${UNAME}`}>
<User />
<span>{` ${UNAME}`}</span>
<span data-cy="uname">{` ${UNAME}`}</span>
</span>
<span title={`Group: ${GNAME}`}>
<Group />
<span>{` ${GNAME}`}</span>
<span data-cy="gname">{` ${GNAME}`}</span>
</span>
<span title={`Hostname: ${HOSTNAME}`}>
<HardDrive />
<span>{` ${HOSTNAME}`}</span>
<span data-cy="hostname">{` ${HOSTNAME}`}</span>
</span>
</div>
</div>
@@ -26,6 +26,7 @@ import MultipleTags from 'client/components/MultipleTags'
function VirtualMachines() {
const [selectedRows, onSelectedRowsChange] = useState(() => [])
const actions = VmActions()
const dataCy = 'vms'
return (
<Stack height={1} py={2} overflow="auto" component={Container}>
@@ -33,7 +34,8 @@ function VirtualMachines() {
<VmsTable
onSelectedRowsChange={onSelectedRowsChange}
globalActions={actions}
rootProps={{ 'data-cy': 'vms' }}
rootProps={{ 'data-cy': dataCy }}
searchProps={{ 'data-cy': `search-${dataCy}` }}
/>
{selectedRows?.length > 0 && (