From 8827faa7a075583892b75fc7ba99160e94978119 Mon Sep 17 00:00:00 2001 From: Angelika Kinas Date: Thu, 12 Dec 2024 12:05:04 +0100 Subject: [PATCH] chore: fix e2e test --- .../src/e2e/record-actions.cy.ts | 17 +++++++++++++---- ...m-field-online-link-resources.component.html | 1 + .../form-field-online-resources.component.html | 1 + .../form-field-overviews.component.html | 1 + 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/apps/metadata-editor-e2e/src/e2e/record-actions.cy.ts b/apps/metadata-editor-e2e/src/e2e/record-actions.cy.ts index 94d6281f0..76dd78186 100644 --- a/apps/metadata-editor-e2e/src/e2e/record-actions.cy.ts +++ b/apps/metadata-editor-e2e/src/e2e/record-actions.cy.ts @@ -122,8 +122,11 @@ describe('record-actions', () => { .should('be.disabled') cy.get('gn-ui-form-field-overviews') .children() - .find('div') - .should('contain.text', ' This field will be enabled once published ') + .find('[data-test="disabled-message"]') + .should( + 'contain.text', + ' This field will be enabled once the data has been published ' + ) // second page cy.get('[data-test="previousNextPageButtons"]') @@ -140,7 +143,10 @@ describe('record-actions', () => { cy.get('gn-ui-form-field-online-resources') .children() .find('div') - .should('contain.text', ' This field will be enabled once published ') + .should( + 'contain.text', + ' This field will be enabled once the data has been published ' + ) cy.get('gn-ui-form-field-online-link-resources') .find('input') @@ -148,7 +154,10 @@ describe('record-actions', () => { cy.get('gn-ui-form-field-online-link-resources') .children() .find('div') - .should('contain.text', ' This field will be enabled once published ') + .should( + 'contain.text', + ' This field will be enabled once the data has been published ' + ) }) it('back navigation should go to search after creating a record', () => { diff --git a/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-link-resources/form-field-online-link-resources.component.html b/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-link-resources/form-field-online-link-resources.component.html index e29bf0db6..141c397bf 100644 --- a/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-link-resources/form-field-online-link-resources.component.html +++ b/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-link-resources/form-field-online-link-resources.component.html @@ -51,6 +51,7 @@

*ngIf="disabled$ | async" class="p-4 text-sm border border-primary bg-primary-lightest rounded-lg" translate + data-testid="disabled-message" > editor.record.form.field.draft.only.disabled diff --git a/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-resources/form-field-online-resources.component.html b/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-resources/form-field-online-resources.component.html index 5ba8d4c44..3d54511b2 100644 --- a/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-resources/form-field-online-resources.component.html +++ b/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-resources/form-field-online-resources.component.html @@ -81,6 +81,7 @@

*ngIf="disabled$ | async" class="p-4 text-sm border border-primary bg-primary-lightest rounded-lg" translate + data-test="disabled-message" > editor.record.form.field.draft.only.disabled diff --git a/libs/feature/editor/src/lib/components/record-form/form-field/form-field-overviews/form-field-overviews.component.html b/libs/feature/editor/src/lib/components/record-form/form-field/form-field-overviews/form-field-overviews.component.html index 51ec69c75..6ed3d8e0e 100644 --- a/libs/feature/editor/src/lib/components/record-form/form-field/form-field-overviews/form-field-overviews.component.html +++ b/libs/feature/editor/src/lib/components/record-form/form-field/form-field-overviews/form-field-overviews.component.html @@ -15,6 +15,7 @@ *ngIf="disabled$ | async" class="p-4 text-sm border border-primary bg-primary-lightest rounded-lg" translate + data-test="disabled-message" > editor.record.form.field.draft.only.disabled