Fix failing tests
DDF requires a bit altered tests to click trough the wizard so the tests won't fail
This commit is contained in:
parent
9bf30059f6
commit
a67e014dbe
8 changed files with 151 additions and 102 deletions
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable react/display-name */
|
||||
import React from 'react';
|
||||
import FormRenderer from '@data-driven-forms/react-form-renderer/form-renderer';
|
||||
import Pf4FormTemplate from '@data-driven-forms/pf4-component-mapper/form-template';
|
||||
|
|
@ -22,6 +23,7 @@ const CreateImageWizard = ({ schema, onSubmit, onClose, customComponentMapper, d
|
|||
// wizard: WrappedWizard,
|
||||
review: Review,
|
||||
output: TargetEnvironment,
|
||||
select: Select,
|
||||
'package-selector': {
|
||||
component: Packages,
|
||||
defaultArch
|
||||
|
|
|
|||
|
|
@ -42,7 +42,16 @@ const ReviewStep = () => {
|
|||
<Text component={ TextVariants.h3 }>Registration</Text>
|
||||
<TextList component={ TextListVariants.dl } data-testid='review-image-registration'>
|
||||
<TextListItem component={ TextListItemVariants.dt }>Subscription</TextListItem>
|
||||
{registerValues?.[getState()?.values?.['register-system']]}
|
||||
<TextListItem component={ TextListItemVariants.dd }>
|
||||
{getState()?.values?.['register-system'] === 'subscribe-now-radio' ?
|
||||
'Register the system on first boot' :
|
||||
registerValues?.[getState()?.values?.['register-system']?.title]
|
||||
}
|
||||
</TextListItem>
|
||||
<TextListItem component={ TextListItemVariants.dt }>Activation key</TextListItem>
|
||||
<TextListItem component={ TextListItemVariants.dd } type="password">
|
||||
{'*'.repeat(getState()?.values?.['subscription-activation']?.length)}
|
||||
</TextListItem>
|
||||
</TextList>
|
||||
</TextContent>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ export default {
|
|||
{
|
||||
component: componentTypes.TEXT_FIELD,
|
||||
name: 'aws-account-id',
|
||||
'data-testid': 'aws-account-id',
|
||||
type: 'text',
|
||||
label: 'AWS account ID',
|
||||
isRequired: true,
|
||||
|
|
|
|||
|
|
@ -89,6 +89,7 @@ export default {
|
|||
{
|
||||
component: componentTypes.TEXT_FIELD,
|
||||
name: 'google-email',
|
||||
'data-testid': 'input-google-email',
|
||||
type: 'text',
|
||||
label: 'Email address',
|
||||
condition: {
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@ export default {
|
|||
{
|
||||
component: componentTypes.TEXT_FIELD,
|
||||
name: 'azure-tenant-id',
|
||||
'data-testid': 'azure-tenant-id',
|
||||
type: 'text',
|
||||
label: 'Tenant ID',
|
||||
isRequired: true,
|
||||
|
|
@ -60,6 +61,7 @@ export default {
|
|||
{
|
||||
component: componentTypes.TEXT_FIELD,
|
||||
name: 'azure-subscription-id',
|
||||
'data-testid': 'azure-subscription-id',
|
||||
type: 'text',
|
||||
label: 'Subscription ID',
|
||||
isRequired: true,
|
||||
|
|
@ -72,6 +74,7 @@ export default {
|
|||
{
|
||||
component: componentTypes.TEXT_FIELD,
|
||||
name: 'azure-resource-group',
|
||||
'data-testid': 'azure-resource-group',
|
||||
type: 'text',
|
||||
label: 'Resource group',
|
||||
isRequired: true,
|
||||
|
|
|
|||
|
|
@ -2,8 +2,14 @@ import componentTypes from '@data-driven-forms/react-form-renderer/component-typ
|
|||
import validatorTypes from '@data-driven-forms/react-form-renderer/validator-types';
|
||||
|
||||
export const registerValues = {
|
||||
'subscribe-now-radio': 'Embed an activation key and register systems on first boot',
|
||||
'register-later-radio-button': 'Register the system later'
|
||||
'subscribe-now-radio': {
|
||||
title: 'Embed an activation key and register systems on first boot',
|
||||
testId: 'register-now-radio-button'
|
||||
},
|
||||
'register-later-radio-button': {
|
||||
title: 'Register the system later',
|
||||
testId: 'register-later-radio-button'
|
||||
}
|
||||
};
|
||||
|
||||
export default (user) => ({
|
||||
|
|
@ -16,15 +22,17 @@ export default (user) => ({
|
|||
label: 'Register the system',
|
||||
name: 'register-system',
|
||||
initialValue: 'register-later-radio-button',
|
||||
options: Object.entries(registerValues).map(([ key, title ]) => ({
|
||||
options: Object.entries(registerValues).map(([ key, { title, testId }]) => ({
|
||||
label: title,
|
||||
value: key
|
||||
value: key,
|
||||
'data-testid': testId,
|
||||
}))
|
||||
},
|
||||
{
|
||||
component: componentTypes.TEXT_FIELD,
|
||||
name: 'subscription-organization',
|
||||
type: 'text',
|
||||
'data-testid': 'organization-id',
|
||||
label: 'Organization ID',
|
||||
initialValue: Number(user?.identity?.internal?.org_id),
|
||||
isDisabled: true,
|
||||
|
|
@ -37,6 +45,8 @@ export default (user) => ({
|
|||
{
|
||||
component: componentTypes.TEXT_FIELD,
|
||||
name: 'subscription-activation',
|
||||
'data-testid': 'subscription-activation',
|
||||
required: true,
|
||||
type: 'password',
|
||||
label: 'Activation key',
|
||||
condition: {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue