1
0
mirror of https://github.com/OpenNebula/one.git synced 2024-12-24 21:34:01 +03:00

F #5422: add data-cy create template (#1665)

This commit is contained in:
Jorge Miguel Lobo Escalona 2021-12-13 18:40:37 +01:00 committed by GitHub
parent b98fdfe3d3
commit 8baad6790e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 12 additions and 2 deletions

View File

@ -62,7 +62,11 @@ const ConfigurationSection = () => {
id={EXTRA_ID}
/>
<Stack direction="row" gap="1em">
<Button onClick={handleAddUserKey} variant="contained">
<Button
onClick={handleAddUserKey}
variant="contained"
data-cy={`${EXTRA_ID}-add-context-ssh-public-key`}
>
{T.AddUserSshPublicKey}
</Button>
<Button onClick={handleClearKey} variant="outlined">

View File

@ -167,6 +167,7 @@ const UserInputsSection = () => {
color="secondary"
startIcon={<AddCircledOutline />}
sx={{ mt: '1em' }}
data-cy={`${EXTRA_ID}-add-context-user-input`}
>
<Translate word={T.Add} />
</Button>

View File

@ -78,6 +78,7 @@ const InputsSection = ({ fields }) => {
color="secondary"
startIcon={<AddCircledOutline />}
sx={{ mt: '1em' }}
data-cy={`${EXTRA_ID}-add-io-inputs`}
>
<Translate word={T.Add} />
</Button>

View File

@ -25,20 +25,23 @@ const InformationPanel = ({ template = {}, handleRename, actions }) => {
const { ID, NAME, REGTIME, LOCK } = template
const info = [
{ name: T.ID, value: ID },
{ name: T.ID, value: ID, dataCy: 'id' },
{
name: T.Name,
value: NAME,
canEdit: actions?.includes?.(VM_TEMPLATE_ACTIONS.RENAME),
handleEdit: handleRename,
dataCy: 'name',
},
{
name: T.StartTime,
value: Helper.timeToString(REGTIME),
dataCy: 'starttime',
},
{
name: T.Locked,
value: Helper.levelLockToString(LOCK?.LOCKED),
dataCy: 'locked',
},
]

View File

@ -61,6 +61,7 @@ const VmTemplateTabs = memo(({ id }) => {
return (
TabContent && {
name: camelName,
id: tabName,
renderContent: (props) => TabContent({ ...props, tabProps }),
}
)