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
No related branches found
No related tags found
No related merge requests found
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<ods-button <ods-button
variant="outline" variant="outline"
text="Anfrage erstellen" text="Anfrage erstellen"
data-test-id="anfrage-erstellen-button" dataTestId="anfrage-erstellen-button"
(clickEmitter)="showRequestForm()" (clickEmitter)="showRequestForm()"
> >
<ods-collaboration-icon icon /> <ods-collaboration-icon icon />
......
...@@ -6,9 +6,9 @@ import { ...@@ -6,9 +6,9 @@ import {
notExistsAsHtmlElement, notExistsAsHtmlElement,
} from '@alfa-client/test-utils'; } from '@alfa-client/test-utils';
import { ComponentFixture, TestBed } from '@angular/core/testing'; 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 { 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 { MockComponent } from 'ng-mocks';
import { of } from 'rxjs'; import { of } from 'rxjs';
import { CollaborationInVorgangContainerComponent } from './collaboration-in-vorgang-container.component'; import { CollaborationInVorgangContainerComponent } from './collaboration-in-vorgang-container.component';
...@@ -18,7 +18,7 @@ describe('CollaborationInVorgangContainerComponent', () => { ...@@ -18,7 +18,7 @@ describe('CollaborationInVorgangContainerComponent', () => {
let component: CollaborationInVorgangContainerComponent; let component: CollaborationInVorgangContainerComponent;
let fixture: ComponentFixture<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 collaborationRequestContainer: string = getDataTestIdOf('collaboration-request-container');
const service: Mock<CollaborationService> = { const service: Mock<CollaborationService> = {
...@@ -28,9 +28,9 @@ describe('CollaborationInVorgangContainerComponent', () => { ...@@ -28,9 +28,9 @@ describe('CollaborationInVorgangContainerComponent', () => {
beforeEach(async () => { beforeEach(async () => {
await TestBed.configureTestingModule({ await TestBed.configureTestingModule({
imports: [ButtonComponent, SaveIconComponent],
declarations: [ declarations: [
CollaborationInVorgangContainerComponent, CollaborationInVorgangContainerComponent,
MockComponent(ButtonComponent),
MockComponent(CollaborationRequestContainerComponent), MockComponent(CollaborationRequestContainerComponent),
MockComponent(CollaborationIconComponent), MockComponent(CollaborationIconComponent),
], ],
......
...@@ -11,11 +11,11 @@ ...@@ -11,11 +11,11 @@
</div> </div>
<div class="flex items-center gap-6"> <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 <ods-button
variant="outline" variant="outline"
text="Abbrechen" text="Abbrechen"
data-test-id="collaboration-request-abbrechen-button" dataTestId="collaboration-request-cancel-button"
(clickEmitter)="hideRequestForm.emit()" (clickEmitter)="hideRequestForm.emit()"
> >
<ods-close-icon icon class="fill-primary"></ods-close-icon> <ods-close-icon icon class="fill-primary"></ods-close-icon>
......
...@@ -2,7 +2,7 @@ import { dispatchEventFromFixture } from '@alfa-client/test-utils'; ...@@ -2,7 +2,7 @@ import { dispatchEventFromFixture } from '@alfa-client/test-utils';
import { ComponentFixture, TestBed } from '@angular/core/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing';
import { ButtonComponent, CloseIconComponent } from '@ods/system'; import { ButtonComponent, CloseIconComponent } from '@ods/system';
import { SearchIconComponent } from 'libs/design-system/src/lib/icons/search-icon/search-icon.component'; 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 { MockComponent } from 'ng-mocks';
import { CollaborationRequestContainerComponent } from './collaboration-request-container.component'; import { CollaborationRequestContainerComponent } from './collaboration-request-container.component';
import { CollaborationRequestFormComponent } from './collaboration-request-form/collaboration-request-form.component'; import { CollaborationRequestFormComponent } from './collaboration-request-form/collaboration-request-form.component';
...@@ -11,13 +11,13 @@ describe('CollaborationRequestContainerComponent', () => { ...@@ -11,13 +11,13 @@ describe('CollaborationRequestContainerComponent', () => {
let component: CollaborationRequestContainerComponent; let component: CollaborationRequestContainerComponent;
let fixture: ComponentFixture<CollaborationRequestContainerComponent>; let fixture: ComponentFixture<CollaborationRequestContainerComponent>;
const abbrechenButton: string = getDataTestIdOf('collaboration-request-abbrechen-button'); const cancelButton: string = getDataTestIdAttributeOf('collaboration-request-cancel-button');
beforeEach(async () => { beforeEach(async () => {
await TestBed.configureTestingModule({ await TestBed.configureTestingModule({
imports: [ButtonComponent],
declarations: [ declarations: [
CollaborationRequestContainerComponent, CollaborationRequestContainerComponent,
MockComponent(ButtonComponent),
MockComponent(SearchIconComponent), MockComponent(SearchIconComponent),
MockComponent(CloseIconComponent), MockComponent(CloseIconComponent),
MockComponent(CollaborationRequestFormComponent), MockComponent(CollaborationRequestFormComponent),
...@@ -33,11 +33,11 @@ describe('CollaborationRequestContainerComponent', () => { ...@@ -33,11 +33,11 @@ describe('CollaborationRequestContainerComponent', () => {
expect(component).toBeTruthy(); expect(component).toBeTruthy();
}); });
describe('abbrechen button', () => { describe('cancel button', () => {
it('should emit hideRequestForm', () => { it('should emit hideRequestForm', () => {
const emitSpy = (component.hideRequestForm.emit = jest.fn()); const emitSpy = (component.hideRequestForm.emit = jest.fn());
dispatchEventFromFixture(fixture, abbrechenButton, 'clickEmitter'); dispatchEventFromFixture(fixture, cancelButton, 'clickEmitter');
expect(emitSpy).toHaveBeenCalled(); expect(emitSpy).toHaveBeenCalled();
}); });
......
...@@ -28,3 +28,7 @@ export function getDataTestClassOf(value: string): string { ...@@ -28,3 +28,7 @@ export function getDataTestClassOf(value: string): string {
export function getDataTestIdOf(value: string): string { export function getDataTestIdOf(value: string): string {
return `[data-test-id="${value}"]`; 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