Skip to content
Snippets Groups Projects
Commit 7ac7dec6 authored by OZGCloud's avatar OZGCloud
Browse files

Merge branch 'master' into OZG-6300-OZG-6417-Zusammarbeit-E2E

parents 0cdd1416 da0d3593
Branches
Tags
No related merge requests found
......@@ -2,7 +2,7 @@
<ods-button
variant="outline"
text="Anfrage erstellen"
data-test-id="anfrage-erstellen-button"
dataTestId="anfrage-erstellen-button"
(clickEmitter)="showRequestForm()"
>
<ods-collaboration-icon icon />
......
......@@ -6,9 +6,9 @@ import {
notExistsAsHtmlElement,
} from '@alfa-client/test-utils';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { ButtonComponent, CollaborationIconComponent, SaveIconComponent } from '@ods/system';
import { ButtonComponent, CollaborationIconComponent } from '@ods/system';
import { CollaborationService } from 'libs/collaboration-shared/src/lib/collaboration.service';
import { getDataTestIdOf } from 'libs/tech-shared/test/data-test';
import { getDataTestIdAttributeOf, getDataTestIdOf } from 'libs/tech-shared/test/data-test';
import { MockComponent } from 'ng-mocks';
import { of } from 'rxjs';
import { CollaborationInVorgangContainerComponent } from './collaboration-in-vorgang-container.component';
......@@ -18,7 +18,7 @@ describe('CollaborationInVorgangContainerComponent', () => {
let component: CollaborationInVorgangContainerComponent;
let fixture: ComponentFixture<CollaborationInVorgangContainerComponent>;
const anfrageErstellenButton: string = getDataTestIdOf('anfrage-erstellen-button');
const anfrageErstellenButton: string = getDataTestIdAttributeOf('anfrage-erstellen-button');
const collaborationRequestContainer: string = getDataTestIdOf('collaboration-request-container');
const service: Mock<CollaborationService> = {
......@@ -28,9 +28,9 @@ describe('CollaborationInVorgangContainerComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [ButtonComponent, SaveIconComponent],
declarations: [
CollaborationInVorgangContainerComponent,
MockComponent(ButtonComponent),
MockComponent(CollaborationRequestContainerComponent),
MockComponent(CollaborationIconComponent),
],
......
......@@ -11,11 +11,11 @@
</div>
<div class="flex items-center gap-6">
<ods-button text="Zuarbeit anfragen" data-test-id="zuarbeit-anfragen-button"></ods-button>
<ods-button text="Zuarbeit anfragen" dataTestId="collaboration-request-send-button"></ods-button>
<ods-button
variant="outline"
text="Abbrechen"
data-test-id="collaboration-request-abbrechen-button"
dataTestId="collaboration-request-cancel-button"
(clickEmitter)="hideRequestForm.emit()"
>
<ods-close-icon icon class="fill-primary"></ods-close-icon>
......
......@@ -2,7 +2,7 @@ import { dispatchEventFromFixture } from '@alfa-client/test-utils';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { ButtonComponent, CloseIconComponent } from '@ods/system';
import { SearchIconComponent } from 'libs/design-system/src/lib/icons/search-icon/search-icon.component';
import { getDataTestIdOf } from 'libs/tech-shared/test/data-test';
import { getDataTestIdAttributeOf } from 'libs/tech-shared/test/data-test';
import { MockComponent } from 'ng-mocks';
import { CollaborationRequestContainerComponent } from './collaboration-request-container.component';
import { CollaborationRequestFormComponent } from './collaboration-request-form/collaboration-request-form.component';
......@@ -11,13 +11,13 @@ describe('CollaborationRequestContainerComponent', () => {
let component: CollaborationRequestContainerComponent;
let fixture: ComponentFixture<CollaborationRequestContainerComponent>;
const abbrechenButton: string = getDataTestIdOf('collaboration-request-abbrechen-button');
const cancelButton: string = getDataTestIdAttributeOf('collaboration-request-cancel-button');
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [ButtonComponent],
declarations: [
CollaborationRequestContainerComponent,
MockComponent(ButtonComponent),
MockComponent(SearchIconComponent),
MockComponent(CloseIconComponent),
MockComponent(CollaborationRequestFormComponent),
......@@ -33,11 +33,11 @@ describe('CollaborationRequestContainerComponent', () => {
expect(component).toBeTruthy();
});
describe('abbrechen button', () => {
describe('cancel button', () => {
it('should emit hideRequestForm', () => {
const emitSpy = (component.hideRequestForm.emit = jest.fn());
dispatchEventFromFixture(fixture, abbrechenButton, 'clickEmitter');
dispatchEventFromFixture(fixture, cancelButton, 'clickEmitter');
expect(emitSpy).toHaveBeenCalled();
});
......
......@@ -28,3 +28,7 @@ export function getDataTestClassOf(value: string): string {
export function getDataTestIdOf(value: string): string {
return `[data-test-id="${value}"]`;
}
export function getDataTestIdAttributeOf(value: string): string {
return `[dataTestId="${value}"]`;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment