1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-02-08 05:57:23 +03:00

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

This commit is contained in:
Jorge Miguel Lobo Escalona 2022-01-18 11:41:59 +01:00 committed by GitHub
parent 5c8334e9f9
commit 05fa7e07ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 14 additions and 10 deletions

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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 && (