From c7ab85f5e03567d7ab60490cdbd4195e0ad5b7b3 Mon Sep 17 00:00:00 2001 From: Laurent Bonnet Date: Fri, 13 Sep 2024 20:54:37 +0200 Subject: [PATCH] [frontend] fix e2e (1) --- .../components/analyses/reports/ReportCreation.tsx | 8 ++++---- .../tests_e2e/model/form/reportForm.pageModel.ts | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/opencti-platform/opencti-front/src/private/components/analyses/reports/ReportCreation.tsx b/opencti-platform/opencti-front/src/private/components/analyses/reports/ReportCreation.tsx index a5a4e6d5352d5..2b30cb39b7b50 100644 --- a/opencti-platform/opencti-front/src/private/components/analyses/reports/ReportCreation.tsx +++ b/opencti-platform/opencti-front/src/private/components/analyses/reports/ReportCreation.tsx @@ -27,7 +27,7 @@ import ObjectAssigneeField from '../../common/form/ObjectAssigneeField'; import { useSchemaCreationValidation } from '../../../../utils/hooks/useEntitySettings'; import { Option } from '../../common/form/ReferenceField'; import type { Theme } from '../../../../components/Theme'; -import { ReportCreationMutation, ReportCreationMutation$variables } from './__generated__/ReportCreationMutation.graphql'; +import { ReportCreationMutation, ReportAddInput } from './__generated__/ReportCreationMutation.graphql'; import useDefaultValues from '../../../../utils/hooks/useDefaultValues'; import RichTextField from '../../../../components/fields/RichTextField'; import ObjectParticipantField from '../../common/form/ObjectParticipantField'; @@ -127,7 +127,7 @@ export const ReportCreationForm: FunctionComponent = ({ values, { setSubmitting, setErrors, resetForm }, ) => { - const input: ReportCreationMutation$variables['input'] = { + const input = { name: values.name, description: values.description, content: values.content, @@ -142,7 +142,7 @@ export const ReportCreationForm: FunctionComponent = ({ objectLabel: values.objectLabel.map((v) => v.value), externalReferences: values.externalReferences.map(({ value }) => value), file: values.file, - }; + } as ReportAddInput; commit({ variables: { input, @@ -185,7 +185,7 @@ export const ReportCreationForm: FunctionComponent = ({ objectLabel: [], externalReferences: [], file: undefined, - }); + } as ReportAddInput); return ( initialValues={initialValues} diff --git a/opencti-platform/opencti-front/tests_e2e/model/form/reportForm.pageModel.ts b/opencti-platform/opencti-front/tests_e2e/model/form/reportForm.pageModel.ts index f5d4b2302c5fa..bc0f751e60d87 100644 --- a/opencti-platform/opencti-front/tests_e2e/model/form/reportForm.pageModel.ts +++ b/opencti-platform/opencti-front/tests_e2e/model/form/reportForm.pageModel.ts @@ -6,7 +6,7 @@ import TextFieldPageModel from '../field/TextField.pageModel'; import FileFieldPageModel from '../field/FileField.pageModel'; export default class ReportFormPage { - nameField = new TextFieldPageModel(this.page, 'Name', 'text'); + nameField = new TextFieldPageModel(this.page, 'Name', 'text-no-label'); contentField = new TextFieldPageModel(this.page, 'Content', 'rich-content'); descriptionField = new TextFieldPageModel(this.page, 'Description', 'text-area');