Skip to content
Snippets Groups Projects
Commit 0a3e40c8 authored by Martin's avatar Martin
Browse files

OZG-7798 adjust dataTestId after merge; remove suffx from text component

parent b13a36b3
No related branches found
No related tags found
1 merge request!69Ozg 7798 statistik e2 e
Showing
with 25 additions and 24 deletions
...@@ -5,9 +5,9 @@ export class StatistikFieldsFormE2EComponent { ...@@ -5,9 +5,9 @@ export class StatistikFieldsFormE2EComponent {
private readonly formIdInput: string = 'form-id-text-input'; private readonly formIdInput: string = 'form-id-text-input';
private readonly formDataFieldInput: string = 'mapping-field-'; private readonly formDataFieldInput: string = 'mapping-field-';
private readonly addDataFieldButton: string = 'add-mapping-button'; private readonly addDataFieldButton: string = 'add-mapping-button';
private readonly deleteDataFieldButtonPrefix: string = 'remove-mapping-'; private readonly deleteDataFieldButtonPrefix: string = 'remove-mapping-button-';
private readonly saveButton: string = 'save-button'; private readonly saveButton: string = 'save-button';
private readonly cancelButton: string = 'cancel-routing-button'; private readonly cancelButton: string = 'cancel-button';
public getFormEngineInput(): Cypress.Chainable<Element> { public getFormEngineInput(): Cypress.Chainable<Element> {
return cy.getTestElement(this.formEngineInput); return cy.getTestElement(this.formEngineInput);
...@@ -42,7 +42,7 @@ export class StatistikFieldsFormE2EComponent { ...@@ -42,7 +42,7 @@ export class StatistikFieldsFormE2EComponent {
} }
public getDataFieldDeleteButton(index: number): Cypress.Chainable<Element> { public getDataFieldDeleteButton(index: number): Cypress.Chainable<Element> {
return cy.getTestElement(this.deleteDataFieldButtonPrefix + index + '-button'); return cy.getTestElement(this.deleteDataFieldButtonPrefix + index);
} }
public deleteDataField(index: number): void { public deleteDataField(index: number): void {
......
export class StatistikE2EComponent { export class StatistikE2EComponent {
private readonly locatorHeaderText: string = 'statistik-header-text'; private readonly locatorHeaderText: string = 'statistik-header-text';
private readonly locatorWeitereFelderAuswertenButton = 'weitere-felder-auswerten-routing-button'; private readonly locatorWeitereFelderAuswertenButton = 'weitere-felder-auswerten-button';
public getHeaderText(): Cypress.Chainable<Element> { public getHeaderText(): Cypress.Chainable<Element> {
return cy.getTestElement(this.locatorHeaderText); return cy.getTestElement(this.locatorHeaderText);
......
import { MainPage, waitForSpinnerToDisappear } from 'apps/admin-e2e/src/page-objects/main.po'; import { MainPage, waitForSpinnerToDisappear } from 'apps/admin-e2e/src/page-objects/main.po';
import { exist, notExist } from 'apps/admin-e2e/src/support/cypress.util'; import { exist, notExist, visible } from 'apps/admin-e2e/src/support/cypress.util';
import { loginAsDaria } from 'apps/admin-e2e/src/support/user-util'; import { loginAsDaria } from 'apps/admin-e2e/src/support/user-util';
import { StatistikE2EComponent } from '../../../components/statistik/statistik.e2e.component'; import { StatistikE2EComponent } from '../../../components/statistik/statistik.e2e.component';
...@@ -37,7 +37,7 @@ describe('Navigation', () => { ...@@ -37,7 +37,7 @@ describe('Navigation', () => {
}); });
it('should show header text', () => { it('should show header text', () => {
statistikPage.isHeaderTextVisible(); visible(statistikPage.getHeaderText());
}); });
}); });
}); });
......
import { MainPage, waitForSpinnerToDisappear } from 'apps/admin-e2e/src/page-objects/main.po'; import { MainPage, waitForSpinnerToDisappear } from 'apps/admin-e2e/src/page-objects/main.po';
import { exist } from 'apps/admin-e2e/src/support/cypress.util'; import { exist, visible } from 'apps/admin-e2e/src/support/cypress.util';
import { loginAsSafira } from 'apps/admin-e2e/src/support/user-util'; import { loginAsSafira } from 'apps/admin-e2e/src/support/user-util';
import { StatistikE2EComponent } from '../../../components/statistik/statistik.e2e.component'; import { StatistikE2EComponent } from '../../../components/statistik/statistik.e2e.component';
...@@ -38,7 +38,7 @@ describe('Navigation', () => { ...@@ -38,7 +38,7 @@ describe('Navigation', () => {
}); });
it('should show page on selection', () => { it('should show page on selection', () => {
statistikPage.isHeaderTextVisible(); visible(statistikPage.getHeaderText());
}); });
it('should mark navigation item as selected', () => { it('should mark navigation item as selected', () => {
......
<ods-routing-button [linkPath]="linkPath" text="Abbrechen" variant="outline" dataTestId="cancel"> <ods-routing-button [linkPath]="linkPath" text="Abbrechen" variant="outline" dataTestId="cancel-button">
<ods-close-icon icon class="fill-primary" /> <ods-close-icon icon class="fill-primary" />
</ods-routing-button> </ods-routing-button>
<ods-open-dialog-button variant='outline_error' label="Löschen" dataTestId="delete-button" > <ods-open-dialog-button variant="outline_error" label="Löschen" dataTestId="delete-button">
<ods-delete-icon icon /> <ods-delete-icon icon />
</ods-open-dialog-button> </ods-open-dialog-button>
<ods-button-with-spinner (clickEmitter)="submit()" text="Speichern" dataTestId="save" [stateResource]="stateResource$ | async" /> <ods-button-with-spinner
(clickEmitter)="submit()"
text="Speichern"
dataTestId="save-button"
[stateResource]="stateResource$ | async"
/>
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
<ods-routing-button <ods-routing-button
[linkPath]="ROUTES.STATISTIK_NEU" [linkPath]="ROUTES.STATISTIK_NEU"
text="Weitere Felder auswerten" text="Weitere Felder auswerten"
dataTestId="weitere-felder-auswerten" dataTestId="weitere-felder-auswerten-button"
></ods-routing-button> ></ods-routing-button>
</div> </div>
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
</form> </form>
<ods-button <ods-button
text="Datenfeld hinzufügen" text="Datenfeld hinzufügen"
dataTestId="add-mapping" dataTestId="add-mapping-button"
data-test-id="add-mapping" data-test-id="add-mapping"
(clickEmitter)="formService.addMapping()" (clickEmitter)="formService.addMapping()"
> >
......
...@@ -19,8 +19,8 @@ ...@@ -19,8 +19,8 @@
size="fit" size="fit"
destructive="true" destructive="true"
(clickEmitter)="formService.removeMapping(i)" (clickEmitter)="formService.removeMapping(i)"
[dataTestId]="'remove-mapping-' + i" [dataTestId]="'remove-mapping-button-' + i"
[attr.data-test-id]="'remove-mapping-button-' + i" [attr.data-test-id]="'remove-mapping-' + i"
> >
<ods-delete-icon icon /> <ods-delete-icon icon />
</ods-button> </ods-button>
......
...@@ -15,7 +15,7 @@ describe('AdminStatistikFieldsFormMappingComponent', () => { ...@@ -15,7 +15,7 @@ describe('AdminStatistikFieldsFormMappingComponent', () => {
let fixture: ComponentFixture<AdminStatistikFieldsFormMappingComponent>; let fixture: ComponentFixture<AdminStatistikFieldsFormMappingComponent>;
const mappingField: string = getDataTestIdOf('mapping-field-0'); const mappingField: string = getDataTestIdOf('mapping-field-0');
const removeMappingButton: string = getDataTestIdOf('remove-mapping-button-0'); const removeMappingButton: string = getDataTestIdOf('remove-mapping-0');
const formBuilder: FormBuilder = new FormBuilder(); const formBuilder: FormBuilder = new FormBuilder();
......
...@@ -8,11 +8,7 @@ import { ButtonVariants, buttonVariants } from '@ods/system'; ...@@ -8,11 +8,7 @@ import { ButtonVariants, buttonVariants } from '@ods/system';
standalone: true, standalone: true,
imports: [CommonModule, RouterLink], imports: [CommonModule, RouterLink],
host: { class: 'block' }, host: { class: 'block' },
template: `<a template: `<a [routerLink]="'/' + linkPath" [attr.data-test-id]="dataTestId" [ngClass]="buttonVariants({ size, variant })">
[routerLink]="'/' + linkPath"
[attr.data-test-id]="dataTestId + '-routing-button'"
[ngClass]="buttonVariants({ size, variant })"
>
<ng-content select="[icon]" /> <ng-content select="[icon]" />
@if (text) { @if (text) {
<p class="flex-grow">{{ text }}</p> <p class="flex-grow">{{ text }}</p>
......
...@@ -95,7 +95,7 @@ export type ButtonVariants = VariantProps<typeof buttonVariants>; ...@@ -95,7 +95,7 @@ export type ButtonVariants = VariantProps<typeof buttonVariants>;
[disabled]="isDisabled" [disabled]="isDisabled"
[attr.aria-disabled]="isDisabled" [attr.aria-disabled]="isDisabled"
[attr.aria-label]="text" [attr.aria-label]="text"
[attr.data-test-id]="dataTestId + '-button'" [attr.data-test-id]="dataTestId"
(click)="clickEmitter.emit()" (click)="clickEmitter.emit()"
> >
<ng-content *ngIf="!isLoading" select="[icon]"></ng-content> <ng-content *ngIf="!isLoading" select="[icon]"></ng-content>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment