Skip to content
Snippets Groups Projects
Commit 03b3aa8e authored by OZGCloud's avatar OZGCloud
Browse files

Merge branch 'master' into OZG-6641-Vereinheitlichung-Postfach-Typbezeichnung-BayernId

parents 7108f200 a6764926
No related branches found
No related tags found
No related merge requests found
Showing
with 153 additions and 51 deletions
......@@ -211,10 +211,7 @@ services:
- 7080:8080
- 7081:8081
healthcheck:
test: [
'CMD-SHELL',
"wget --spider localhost:8081/version",
]
test: ['CMD-SHELL', 'wget --spider localhost:8081/version']
interval: 5s
timeout: 5s
retries: 5
......
import { enterWith } from '../../support/cypress.util';
import { contains, enterWith, haveValue } from '../../support/cypress.util';
export class VorgangZusammenarbeitE2EComponent {
private readonly anfrageButton: string = 'anfrage-erstellen-button';
......@@ -7,6 +7,12 @@ export class VorgangZusammenarbeitE2EComponent {
private readonly messageText: string = 'Nachricht-textarea';
private readonly sendButton: string = 'collaboration-request-submit-button';
private readonly cancelButton: string = 'collaboration-request-cancel-button';
private readonly searchText: string = 'instant_search-text-input';
private readonly closeSearchButton: string = 'close-search-dialog';
private readonly clearSearchButton: string = 'clear-instant-search';
private readonly searchEntry: string = 'item-button';
private readonly orgaAddress: string = 'organisations-einheit-in-collaboration';
private readonly anfrageResult: string = 'collaboration-request-result';
public getAnfrageButton(): Cypress.Chainable<JQuery<HTMLElement>> {
return cy.getTestElement(this.anfrageButton);
......@@ -64,4 +70,60 @@ export class VorgangZusammenarbeitE2EComponent {
public cancelAnfrage(): void {
this.getCancelButton().click();
}
public getCloseSearchButton(): Cypress.Chainable<JQuery<HTMLElement>> {
return cy.getTestElement(this.closeSearchButton);
}
public closeSearch(): void {
this.getCloseSearchButton().click();
}
public getSearchText(): Cypress.Chainable<JQuery<HTMLElement>> {
return cy.getTestElement(this.searchText);
}
public hasSearchText(text: string): void {
haveValue(this.getSearchText(), text);
}
public enterSearchInput(text: string): void {
this.getSearchText().clear().type(text);
}
public getClearSearchButton(): Cypress.Chainable<JQuery<HTMLElement>> {
return cy.getTestElement(this.clearSearchButton);
}
public clearSearch(): void {
this.getClearSearchButton().click();
}
public countSearchEntries(): Cypress.Chainable<number> {
return cy.getTestElement(this.searchEntry).then((entries) => {
return Cypress.$(entries).length;
});
}
public expectNumberOfEntriesToBe(entries: number): void {
this.countSearchEntries().then((count) => {
expect(count).to.equal(entries);
});
}
public clickSearchEntry(index: number): void {
cy.getTestElement(this.searchEntry).eq(index).click();
}
public addressContains(address: string): void {
contains(cy.getTestElement(this.orgaAddress), address);
}
public getAnfrageResult(): Cypress.Chainable<JQuery<HTMLElement>> {
return cy.getTestElement(this.anfrageResult);
}
public anfrageResultContains(anfrage: string): void {
contains(this.getAnfrageResult(), anfrage);
}
}
......@@ -32,7 +32,7 @@ import {
objectIds,
} from '../../../support/vorgang-util';
describe('Ungelesene Nachrichten', () => {
describe('VorgangList Ungelesene Nachrichten', () => {
const mainPage: MainPage = new MainPage();
const vorgangList: VorgangListE2EComponent = mainPage.getVorgangList();
const vorgangPage: VorgangPage = new VorgangPage();
......
import { registerLocaleData } from '@angular/common';
import localeDe from '@angular/common/locales/de';
import localeDeExtra from '@angular/common/locales/extra/de';
import { SnackBarE2EComponent } from 'apps/alfa-e2e/src/components/ui/snackbar.e2e.component';
import { VorgangZusammenarbeitE2EComponent } from 'apps/alfa-e2e/src/components/vorgang/vorgang-zusammenarbeit.e2e.component';
import { VorgangE2E, VorgangStatusE2E } from 'apps/alfa-e2e/src/model/vorgang';
import { VorgangE2E, VorgangMessagesE2E, VorgangStatusE2E } from 'apps/alfa-e2e/src/model/vorgang';
import 'cypress-real-events/support';
import { VorgangListE2EComponent } from '../../../components/vorgang/vorgang-list.e2e.component';
import { MainPage, waitForSpinnerToDisappear } from '../../../page-objects/main.po';
import { VorgangPage } from '../../../page-objects/vorgang.po';
import { dropCollections } from '../../../support/cypress-helper';
import { exist, notExist } from '../../../support/cypress.util';
import { contains, exist, notExist } from '../../../support/cypress.util';
import { initUsermanagerUsers, loginAsSabine } from '../../../support/user-util';
import { buildVorgang, initVorgaenge, objectIds } from '../../../support/vorgang-util';
......@@ -30,6 +31,9 @@ describe('Vorgang Zusammenarbeit anfragen', () => {
const titleText: string = 'Dies ist ein Test-Titel !"§$%&';
const messageText: string =
'Sehr geehrter Tester\n\n Dies ist ein !"§$%& Test\n zum Testen der Nachricht.\n\n\n\nhier sollte eine \nScrollbar\nangezeigt\nwerden!\n\nMfG!';
const stelleSearch1: string = 'k';
const stelleSearch2: string = 'Kiel';
const snackBar: SnackBarE2EComponent = mainPage.getSnackBar();
before(() => {
initVorgaenge([zusammenarbeitVorgang]);
......@@ -76,48 +80,66 @@ describe('Vorgang Zusammenarbeit anfragen', () => {
it('should open new search label for Zustaendige Stelle', () => {
zusammenarbeitContainer.createAnfrage();
//button click
//Layer wird angezeigt
zusammenarbeitContainer.searchZustaendigeStelle();
exist(zusammenarbeitContainer.getCloseSearchButton());
exist(zusammenarbeitContainer.getSearchText());
});
it('should close layer on Cancel click', () => {
//click Abbrechen
zusammenarbeitContainer.closeSearch();
notExist(zusammenarbeitContainer.getCloseSearchButton());
notExist(zusammenarbeitContainer.getSearchText());
exist(zusammenarbeitContainer.getZustaendigeStelleButton());
});
it('should show no search on entering 1 element', () => {
//1 Zeichen in Suche eingeben
//keine Vorschau
it('should delete search term on clicking X', () => {
zusammenarbeitContainer.searchZustaendigeStelle();
zusammenarbeitContainer.enterSearchInput(stelleSearch1);
zusammenarbeitContainer.clearSearch();
zusammenarbeitContainer.hasSearchText('');
});
it('should show results on entering 2 elements', () => {
//2 Zeichen in Suche eingeben
//Vorschau kontrollieren
it.skip('TODO: Setup Jenkins --- should find 2 results after entering kiel', () => {
zusammenarbeitContainer.enterSearchInput(stelleSearch2);
zusammenarbeitContainer.expectNumberOfEntriesToBe(2);
});
it('should delete search term on clicking X', () => {
//X in Suche klicken
//Suche ist leer
//keine Vorschau
it.skip('should close layer after click on search entry', () => {
zusammenarbeitContainer.clickSearchEntry(0);
exist(zusammenarbeitContainer.getSendButton());
notExist(zusammenarbeitContainer.getSearchText());
});
it('should copy and paste Zustaendige Stelle after selection', () => {
//click Suchergebnis
//Adresse und Name wird übernommen
//Layer ist geschlossen
it.skip('should show part of address in Zufi header', () => {
zusammenarbeitContainer.addressContains(stelleSearch2);
});
it('should be able to enter title and message, and show scrollbar on long text', () => {
it.skip('should be able to enter title and message, and show scrollbar on long text', () => {
zusammenarbeitContainer.enterTitel(titleText);
zusammenarbeitContainer.enterMessage(messageText);
zusammenarbeitContainer.messageScrollbarIsPresent();
});
it('should show title and message read-only and remove buttons after sending', () => {
//Button klicken
//Titel und Datum werden angezeigt
//Nachricht wird angezeigt
//Buttons werden ausgeblendet
it.skip('should show title and message, show snackbar, and remove buttons after sending', () => {
zusammenarbeitContainer.sendAnfrage();
notExist(zusammenarbeitContainer.getSendButton());
notExist(zusammenarbeitContainer.getCancelButton());
zusammenarbeitContainer.anfrageResultContains(titleText);
//TODO: Zeilenumbrüche (OZG-6682)
//zusammenarbeitContainer.anfrageResultContains(messageText);
//TODO: Datum wird angezeigt (OZG-6675)
contains(snackBar.getMessage(), VorgangMessagesE2E.ZUARBEIT_ANGEFRAGT);
});
});
});
......@@ -20,6 +20,8 @@ alfa:
first_name: Emil
last_name: Ansprechpartner
password: 'Y9nk43yrQ_zzIPpfFU-I'
update_user: true
email: emil.ansprechpartner@ozg-sh.de
client_roles:
- name: alfa
role: EINHEITLICHER_ANSPRECHPARTNER
......
......@@ -157,6 +157,7 @@ export enum VorgangMessagesE2E {
LOESCHEN_ANFORDERN = 'Für den Vorgang wurde eine Löschanforderung gestellt.',
ENDGUELTIG_LOESCHEN = 'Der Vorgang wurde gelöscht.',
WIEDERVORLAGE_BEARBEITEN_NICHT_MOEGLICH = 'Im Status "Zu löschen" ist die Bearbeitung von Wiedervorlagen nicht möglich.',
ZUARBEIT_ANGEFRAGT = 'Die Zuarbeit wurde angefragt.',
}
export const NO_AKTENZEICHEN: string = 'kein Aktenzeichen zugewiesen';
<form [formGroup]="formService.form">
<form [formGroup]="formService.form" class="max-w-[960px]">
<h2 class="heading-2">Signatur</h2>
<p id="signatur-desc">
Diese Signatur wird bei allen Nachrichten an den Antragsteller angezeigt.
......@@ -6,8 +6,9 @@
<ods-textarea-editor
[formControlName]="formServiceClass.SIGNATUR_FIELD"
[isResizable]="false"
[showLabel]="false"
data-test-id="signatur-text"
label=""
label="signature"
rows="6"
class="w-full"
aria-describedby="signatur-desc"
......
......@@ -91,7 +91,7 @@ describe('PostfachService', () => {
tick();
expect(snackbarService.showInfo).toHaveBeenCalledWith(
'Die Signatur wird erfolgreich gespeichert.',
'Die Signatur wurde erfolgreich gespeichert.',
);
}));
});
......
......@@ -28,7 +28,7 @@ export class PostfachService {
private showInfoAfterSave(stateResource: StateResource<PostfachResource>) {
if (!stateResource.loading) {
this.snackbarService.showInfo('Die Signatur wird erfolgreich gespeichert.');
this.snackbarService.showInfo('Die Signatur wurde erfolgreich gespeichert.');
}
}
......
......@@ -7,6 +7,7 @@
[attr.data-test-id]="(label | convertForDataTest) + '-text-editor'"
[required]="isRequired"
[focus]="focus"
[showLabel]="showLabel"
>
<ods-validation-error
error
......
......@@ -24,6 +24,7 @@ export class TextEditorComponent extends FormControlEditorAbstractComponent {
@Input() placeholder: string = '';
@Input() isRequired: boolean = false;
@Input() focus: boolean = false;
@Input() showLabel: boolean = true;
get variant(): string {
return this.invalidParams.length > 0 ? 'error' : 'default';
......
......@@ -8,6 +8,7 @@
[required]="isRequired"
[focus]="focus"
[isResizable]="isResizable"
[showLabel]="showLabel"
>
<ods-validation-error
error
......
......@@ -25,6 +25,7 @@ export class TextareaEditorComponent extends FormControlEditorAbstractComponent
@Input() isRequired: boolean = false;
@Input() focus: boolean = false;
@Input() isResizable: boolean = true;
@Input() showLabel: boolean = true;
get variant(): string {
return this.invalidParams.length > 0 ? 'error' : 'default';
......
......@@ -31,7 +31,7 @@ type TextareaVariants = VariantProps<typeof textareaVariants>;
imports: [CommonModule, ReactiveFormsModule, TechSharedModule],
template: `
<div class="mt-2">
<label [for]="id" class="text-md mb-2 block font-medium text-text">
<label *ngIf="showLabel" [for]="id" class="text-md mb-2 block font-medium text-text">
{{ inputLabel }}<ng-container *ngIf="required"><i aria-hidden="true">*</i></ng-container>
</label>
<textarea
......@@ -65,6 +65,7 @@ export class TextareaComponent {
@Input() fieldControl: FormControl = new FormControl(EMPTY_STRING);
@Input() required: boolean = false;
@Input() isResizable: boolean = true;
@Input() showLabel: boolean = true;
@Input() set focus(value: boolean) {
if (value && this.textAreaElement) {
......
......@@ -61,4 +61,12 @@ describe('NavItemComponent', () => {
});
});
});
describe('template', () => {
describe('host element role attribute', () => {
it('should be "menuitem"', () => {
expect(fixture.nativeElement.getAttribute('role')).toBe('menuitem');
});
});
});
});
import { CommonModule } from '@angular/common';
import { Component, Input } from '@angular/core';
import { Component, HostBinding, Input } from '@angular/core';
import { RouterLink, RouterLinkActive } from '@angular/router';
@Component({
......@@ -14,7 +14,6 @@ import { RouterLink, RouterLinkActive } from '@angular/router';
'border border-transparent hover:border-primary',
'outline-2 outline-offset-4 outline-focus focus-visible:border-background-200',
]"
role="menuitem"
[attr.data-test-id]="'link-to-' + to"
>
<ng-content select="[icon]" />
......@@ -24,4 +23,6 @@ import { RouterLink, RouterLinkActive } from '@angular/router';
export class NavItemComponent {
@Input({ required: true }) caption!: string;
@Input() to: string;
@HostBinding('attr.role') role = 'menuitem';
}
......@@ -23,7 +23,7 @@ import { twMerge } from 'tailwind-merge';
*ngIf="isPopupOpen"
class="absolute max-h-120 min-w-44 max-w-80 animate-fadeIn overflow-y-auto rounded shadow-lg shadow-grayborder focus:outline-none"
[ngClass]="alignTo === 'left' ? 'right-0' : 'left-0'"
role="dialog"
role="menu"
aria-modal="true"
tabIndex="-1"
cdkTrapFocus
......
......@@ -21,12 +21,6 @@
* Die sprachspezifischen Genehmigungen und Beschränkungen
* unter der Lizenz sind dem Lizenztext zu entnehmen.
*/
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { FormBuilder, ReactiveFormsModule } from '@angular/forms';
import { MAT_DIALOG_DATA } from '@angular/material/dialog';
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatInputModule } from '@angular/material/input';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { PostfachService } from '@alfa-client/postfach-shared';
import { createStateResource } from '@alfa-client/tech-shared';
import { Mock, mock, useFromMock } from '@alfa-client/test-utils';
......@@ -39,8 +33,14 @@ import {
TextAreaEditorComponent,
TextEditorComponent,
} from '@alfa-client/ui';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { FormBuilder, ReactiveFormsModule } from '@angular/forms';
import { MAT_DIALOG_DATA } from '@angular/material/dialog';
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatInputModule } from '@angular/material/input';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { createCommandResource } from 'libs/command-shared/test/command';
import { PostfachTestFactory } from 'libs/postfach-shared/test/postfach';
import { PostfachTestFactory, createPostfachSettings } from 'libs/postfach-shared/test/postfach';
import { MockComponent } from 'ng-mocks';
import { of } from 'rxjs';
import { PostfachMailFormComponent } from './postfach-mail-form.component';
......@@ -54,7 +54,10 @@ describe('PostfachMailFormComponent', () => {
let component: PostfachMailFormComponent;
let fixture: ComponentFixture<PostfachMailFormComponent>;
const postfachService: Mock<PostfachService> = mock(PostfachService);
const postfachService: Mock<PostfachService> = {
...mock(PostfachService),
getSettings: jest.fn().mockReturnValue(of(createPostfachSettings())),
};
const formService: PostfachMailFormservice = new PostfachMailFormservice(
new FormBuilder(),
useFromMock(postfachService),
......
{
"name": "alfa",
"version": "1.0.0-SNAPSHOT",
"version": "1.1.0-SNAPSHOT",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "alfa",
"version": "1.0.0-SNAPSHOT",
"version": "1.1.0-SNAPSHOT",
"license": "MIT",
"dependencies": {
"@angular/animations": "17.3.10",
{
"name": "alfa",
"version": "1.0.0-SNAPSHOT",
"version": "1.1.0-SNAPSHOT",
"license": "MIT",
"scripts": {
"start": "nx run alfa:serve --port 4300 --disable-host-check",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment