Skip to content
Snippets Groups Projects
Commit 96202bb1 authored by OZGCloud's avatar OZGCloud
Browse files

OZG-1194 show attachment icon on vorgang detail

parent d3767ea1
No related branches found
No related tags found
No related merge requests found
<goofy-client-incomming-mail *ngIf="isIncomingMail" [postfachMail]="postfachMail"></goofy-client-incomming-mail>
<goofy-client-outgoing-mail *ngIf="!isIncomingMail" [postfachMail]="postfachMail"></goofy-client-outgoing-mail>
<ng-container *ngIf="onPage">
<ng-container *ngIf="onPage; else icon">
<goofy-client-postfach-nachricht-attachments *ngIf="postfachMail | hasLink: postfachNachrichtLinkRel.ATTACHMENTS" data-test-id="postfach-nachricht-attachments-container"
[postfachNachricht]="postfachMail">
</goofy-client-postfach-nachricht-attachments>
</ng-container>
<ng-template #icon>
<mat-icon data-test-id="postfach-nachricht-attachment-icon">attach_file</mat-icon>
</ng-template>
\ No newline at end of file
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { MatIcon } from '@angular/material/icon';
import { ON_PAGE, PostfachMailLinkRel } from '@goofy-client/postfach-shared';
import { HasLinkPipe } from '@goofy-client/tech-shared';
import { getElementFromFixture } from '@goofy-client/test-utils';
......@@ -14,12 +15,14 @@ describe('PostfachMailComponent', () => {
let fixture: ComponentFixture<PostfachMailComponent>;
const attachmentContainer: string = '[data-test-id="postfach-nachricht-attachments-container"]';
const attachmentIcon: string = '[data-test-id="postfach-nachricht-attachment-icon"]';
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [
PostfachMailComponent,
HasLinkPipe,
MatIcon,
MockComponent(IncommingMailComponent),
MockComponent(OutgoingMailComponent),
MockComponent(PostfachNachrichtAttachmentsComponent)
......@@ -27,7 +30,7 @@ describe('PostfachMailComponent', () => {
providers: [
{
provide: ON_PAGE,
useValue: true
useValue: undefined
}
]
}).compileComponents();
......@@ -47,6 +50,7 @@ describe('PostfachMailComponent', () => {
describe('attachments', () => {
it('should not show attachments loaded if exists', () => {
component.onPage = true;
component.postfachMail = createPostfachMailResource();
fixture.detectChanges();
......@@ -56,6 +60,7 @@ describe('PostfachMailComponent', () => {
})
it('should be loaded if exists', () => {
component.onPage = true;
component.postfachMail = createPostfachMailResource([PostfachMailLinkRel.ATTACHMENTS]);
fixture.detectChanges();
......@@ -63,5 +68,14 @@ describe('PostfachMailComponent', () => {
expect(element).toBeInstanceOf(HTMLElement);
})
it('should only show attachment icon on detail', () => {
component.onPage = false;
fixture.detectChanges();
const element = getElementFromFixture(fixture, attachmentIcon);
expect(element).toBeInstanceOf(HTMLElement);
})
})
});
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment