diff --git a/integrations/standalone/tests/integration/dataclass-editor-business-dataclass.spec.ts b/integrations/standalone/tests/integration/dataclass-editor-business-dataclass.spec.ts index 3b583874..a98f72a8 100644 --- a/integrations/standalone/tests/integration/dataclass-editor-business-dataclass.spec.ts +++ b/integrations/standalone/tests/integration/dataclass-editor-business-dataclass.spec.ts @@ -51,6 +51,13 @@ test('save data', async ({ page }) => { await editor.table.row(0).expectToHaveValues('newAttribute', 'String', ''); await editor.table.row(0).locator.click(); + await editor.detail.fillFieldValues('New Name', 'New Type', true, 'New Comment', 'New Annotations'); + + await editor.page.reload(); + + await editor.table.row(0).locator.click(); + await editor.detail.expectToHaveFieldValues('New Name', 'New Type', true, 'New Comment', 'New Annotations'); + await editor.delete.locator.click(); await editor.page.reload(); diff --git a/integrations/standalone/tests/pageobjects/Detail.ts b/integrations/standalone/tests/pageobjects/Detail.ts index f39b98d4..f6352c56 100644 --- a/integrations/standalone/tests/pageobjects/Detail.ts +++ b/integrations/standalone/tests/pageobjects/Detail.ts @@ -73,4 +73,15 @@ export class Detail { await this.description.locator.fill(description); await this.annotations.locator.fill(annotations); } + + async fillFieldValues(name: string, type: string, persistent: boolean, comment: string, annotations: string) { + await this.expectToBeField(); + await this.name.locator.fill(name); + await this.type.locator.fill(type); + if (persistent !== (await this.persistent.isChecked())) { + await this.persistent.click(); + } + await this.comment.locator.fill(comment); + await this.annotations.locator.fill(annotations); + } } diff --git a/packages/dataclass-editor/src/components/dataclass/detail/DataClassDetailContent.tsx b/packages/dataclass-editor/src/components/dataclass/detail/DataClassDetailContent.tsx index 183ee045..ae17e58b 100644 --- a/packages/dataclass-editor/src/components/dataclass/detail/DataClassDetailContent.tsx +++ b/packages/dataclass-editor/src/components/dataclass/detail/DataClassDetailContent.tsx @@ -1,5 +1,6 @@ import { BasicField, Button, Flex, Textarea, ToggleGroup, ToggleGroupItem } from '@axonivy/ui-components'; import { useAppContext } from '../../../context/AppContext'; +import { removeEmptyStrings } from '../../../utils/array/array'; import type { DataClass } from '../data/dataclass'; import { classType } from '../data/dataclass-utils'; import './DetailContent.css'; @@ -56,7 +57,7 @@ export const DataClassDetailContent = () => {