Skip to content
Snippets Groups Projects
Verified Commit 681a96fb authored by Sebastian Bergandy's avatar Sebastian Bergandy :keyboard:
Browse files

OZG-5977 adopt wiedervorlage e2e for multi upload

parent 92f80cb1
Branches
Tags
1 merge request!74OZG-5977 add multi file upload to wiedervorlagen
...@@ -48,6 +48,10 @@ export class AttachmentListE2EComponent { ...@@ -48,6 +48,10 @@ export class AttachmentListE2EComponent {
return new AttachmentE2EItem(fileName); return new AttachmentE2EItem(fileName);
} }
public getLoadingOrErrorItem(fileName: string): LoadingErrorAttachmentE2EItem {
return new LoadingErrorAttachmentE2EItem(fileName);
}
public getDownloadAttachmentsButton(): Cypress.Chainable<JQuery<HTMLElement>> { public getDownloadAttachmentsButton(): Cypress.Chainable<JQuery<HTMLElement>> {
return this.getRoot().findTestElementWithClass(this.downloadAttachmentsButton); return this.getRoot().findTestElementWithClass(this.downloadAttachmentsButton);
} }
...@@ -79,3 +83,16 @@ class AttachmentE2EItem { ...@@ -79,3 +83,16 @@ class AttachmentE2EItem {
return this.getRoot().findTestElementWithClass(this.locatorDownloadButton); return this.getRoot().findTestElementWithClass(this.locatorDownloadButton);
} }
} }
class LoadingErrorAttachmentE2EItem {
private locatorRoot: string;
private readonly attachmentSuffixLocattor: string = '-file-upload-list-item-attachment-upload';
constructor(private fileName: string) {
this.locatorRoot = convertToDataTestId(this.fileName) + this.attachmentSuffixLocattor;
}
public getRoot() {
return cy.getTestElement(this.locatorRoot);
}
}
...@@ -21,47 +21,26 @@ ...@@ -21,47 +21,26 @@
* Die sprachspezifischen Genehmigungen und Beschränkungen * Die sprachspezifischen Genehmigungen und Beschränkungen
* unter der Lizenz sind dem Lizenztext zu entnehmen. * unter der Lizenz sind dem Lizenztext zu entnehmen.
*/ */
import { import { AttachmentContainerE2EComponent, AttachmentListE2EComponent, } from 'apps/alfa-e2e/src/components/attachment/attachment.e2e.component';
AttachmentContainerE2EComponent,
AttachmentListE2EComponent,
} from 'apps/alfa-e2e/src/components/attachment/attachment.e2e.component';
import { WiedervorlageSubnavigationE2EComponent } from 'apps/alfa-e2e/src/components/wiedervorlage/wiedervorlage-subnavigation'; import { WiedervorlageSubnavigationE2EComponent } from 'apps/alfa-e2e/src/components/wiedervorlage/wiedervorlage-subnavigation';
import { BinaryFileSnackbarMessageE2E } from 'apps/alfa-e2e/src/model/binary-file';
import { WiedervorlageE2E } from 'apps/alfa-e2e/src/model/wiedervorlage'; import { WiedervorlageE2E } from 'apps/alfa-e2e/src/model/wiedervorlage';
import { import { dropCollections, readFileFromDownloads, wait } from 'apps/alfa-e2e/src/support/cypress-helper';
dropCollections,
readFileFromDownloads,
wait,
} from 'apps/alfa-e2e/src/support/cypress-helper';
import { initVorgangAttachedItem } from 'apps/alfa-e2e/src/support/vorgang-attached-item-util'; import { initVorgangAttachedItem } from 'apps/alfa-e2e/src/support/vorgang-attached-item-util';
import { SnackBarE2EComponent } from '../../../components/ui/snackbar.e2e.component'; import { SnackBarE2EComponent } from '../../../components/ui/snackbar.e2e.component';
import { VorgangListE2EComponent } from '../../../components/vorgang/vorgang-list.e2e.component'; import { VorgangListE2EComponent } from '../../../components/vorgang/vorgang-list.e2e.component';
import { WiedervorlageInVorgangE2EComponent } from '../../../components/wiedervorlage/wiedervorlage-in-vorgang.e2e.component'; import { WiedervorlageInVorgangE2EComponent } from '../../../components/wiedervorlage/wiedervorlage-in-vorgang.e2e.component';
import { WiedervorlageE2EComponent } from '../../../components/wiedervorlage/wiedervorlage-page.e2e.component'; import { WiedervorlageE2EComponent } from '../../../components/wiedervorlage/wiedervorlage-page.e2e.component';
import { BinaryFileSnackbarMessageE2E } from '../../../model/binary-file';
import { VorgangE2E } from '../../../model/vorgang'; import { VorgangE2E } from '../../../model/vorgang';
import { MainPage, waitForSpinnerToDisappear } from '../../../page-objects/main.po'; import { MainPage, waitForSpinnerToDisappear } from '../../../page-objects/main.po';
import { VorgangPage } from '../../../page-objects/vorgang.po'; import { VorgangPage } from '../../../page-objects/vorgang.po';
import { WiedervorlagePage } from '../../../page-objects/wiedervorlage.po'; import { WiedervorlagePage } from '../../../page-objects/wiedervorlage.po';
import { import { containClass, contains, exist, haveLength, notContainClass, notExist } from '../../../support/cypress.util';
containClass, import { TEST_FILE_WITH_CONTENT, TEST_FILE_WITH_CONTENT_46MB, TEST_FILE_WITHOUT_CONTENT } from '../../../support/data.util';
contains,
exist,
haveLength,
notContainClass,
notExist,
} from '../../../support/cypress.util';
import {
TEST_FILE_WITHOUT_CONTENT,
TEST_FILE_WITH_CONTENT,
TEST_FILE_WITH_CONTENT_46MB,
} from '../../../support/data.util';
import { uploadEmptyFile, uploadFile } from '../../../support/file-upload'; import { uploadEmptyFile, uploadFile } from '../../../support/file-upload';
import { loginAsSabine } from '../../../support/user-util'; import { loginAsSabine } from '../../../support/user-util';
import { createVorgang, initVorgang, objectIds } from '../../../support/vorgang-util'; import { createVorgang, initVorgang, objectIds } from '../../../support/vorgang-util';
import { import { createWiedervorlageAttachedItem, createWiedervorlageItem } from '../../../support/wiedervorlage-util';
createWiedervorlageAttachedItem,
createWiedervorlageItem,
} from '../../../support/wiedervorlage-util';
describe('Wiedervorlage attachments', () => { describe('Wiedervorlage attachments', () => {
const mainPage: MainPage = new MainPage(); const mainPage: MainPage = new MainPage();
...@@ -74,13 +53,10 @@ describe('Wiedervorlage attachments', () => { ...@@ -74,13 +53,10 @@ describe('Wiedervorlage attachments', () => {
const wiedervorlageContainerInVorgang = vorgangPage.getWiedervorlagenContainer(); const wiedervorlageContainerInVorgang = vorgangPage.getWiedervorlagenContainer();
const wiedervorlagePage: WiedervorlagePage = new WiedervorlagePage(); const wiedervorlagePage: WiedervorlagePage = new WiedervorlagePage();
const wiedervorlageContainer: WiedervorlageE2EComponent = const wiedervorlageContainer: WiedervorlageE2EComponent = wiedervorlagePage.getWiedervorlageContainer();
wiedervorlagePage.getWiedervorlageContainer(); const attachmentContainer: AttachmentContainerE2EComponent = wiedervorlageContainer.getAttachmentContainer();
const attachmentContainer: AttachmentContainerE2EComponent =
wiedervorlageContainer.getAttachmentContainer();
const attachmentList: AttachmentListE2EComponent = attachmentContainer.getList(); const attachmentList: AttachmentListE2EComponent = attachmentContainer.getList();
const subnavigation: WiedervorlageSubnavigationE2EComponent = const subnavigation: WiedervorlageSubnavigationE2EComponent = wiedervorlagePage.getSubnavigation();
wiedervorlagePage.getSubnavigation();
const snackbar: SnackBarE2EComponent = mainPage.getSnackBar(); const snackbar: SnackBarE2EComponent = mainPage.getSnackBar();
...@@ -140,23 +116,17 @@ describe('Wiedervorlage attachments', () => { ...@@ -140,23 +116,17 @@ describe('Wiedervorlage attachments', () => {
exist(attachmentList.getItem(TEST_FILE_WITH_CONTENT).getRoot()); exist(attachmentList.getItem(TEST_FILE_WITH_CONTENT).getRoot());
}); });
it('should error snackbar after upload to large file', { defaultCommandTimeout: 30000 }, () => { it('should show failed upload', { defaultCommandTimeout: 30000 }, () => {
uploadFile(attachmentContainer.getUploadInput(), TEST_FILE_WITH_CONTENT_46MB); uploadFile(attachmentContainer.getUploadInput(), TEST_FILE_WITH_CONTENT_46MB);
waitForSpinnerToDisappear(); waitForSpinnerToDisappear();
exist(snackbar.getMessage()); exist(attachmentList.getLoadingOrErrorItem(TEST_FILE_WITH_CONTENT_46MB).getRoot());
contains( contains(
snackbar.getMessage(), attachmentList.getLoadingOrErrorItem(TEST_FILE_WITH_CONTENT_46MB).getRoot(),
BinaryFileSnackbarMessageE2E.ATTACHMENT_NOT_ADDED.replace('{size}', '40MB'), BinaryFileSnackbarMessageE2E.ATTACHMENT_NOT_ADDED.replace('{size}', '40MB'),
); );
}); });
it('should close snackbar on close button', () => {
snackbar.getCloseButton().click();
notExist(snackbar.getMessage());
});
it('should download attachment on click', () => { it('should download attachment on click', () => {
attachmentList.getItem(TEST_FILE_WITH_CONTENT).getDownloadButton().click(); attachmentList.getItem(TEST_FILE_WITH_CONTENT).getDownloadButton().click();
waitForSpinnerToDisappear(); waitForSpinnerToDisappear();
...@@ -169,10 +139,7 @@ describe('Wiedervorlage attachments', () => { ...@@ -169,10 +139,7 @@ describe('Wiedervorlage attachments', () => {
wiedervorlageContainer.getSpeichernButton().click(); wiedervorlageContainer.getSpeichernButton().click();
exist(snackbar.getMessage()); exist(snackbar.getMessage());
contains( contains(snackbar.getMessage(), 'Die Wiedervorlage "' + WIEDERVORLAGE_WITH_ATTACHMENTS_BETREFF + '" wurde angelegt');
snackbar.getMessage(),
'Die Wiedervorlage "' + WIEDERVORLAGE_WITH_ATTACHMENTS_BETREFF + '" wurde angelegt',
);
exist(snackbar.getCloseButton()); exist(snackbar.getCloseButton());
}); });
...@@ -183,9 +150,7 @@ describe('Wiedervorlage attachments', () => { ...@@ -183,9 +150,7 @@ describe('Wiedervorlage attachments', () => {
}); });
it('should show attachments on wiedervorlage in vorgang-detail after save ', () => { it('should show attachments on wiedervorlage in vorgang-detail after save ', () => {
wiedervorlageContainerInVorgang wiedervorlageContainerInVorgang.getWiedervorlage(WIEDERVORLAGE_WITH_ATTACHMENTS_BETREFF).expandItem();
.getWiedervorlage(WIEDERVORLAGE_WITH_ATTACHMENTS_BETREFF)
.expandItem();
exist( exist(
wiedervorlageContainerInVorgang wiedervorlageContainerInVorgang
...@@ -203,6 +168,14 @@ describe('Wiedervorlage attachments', () => { ...@@ -203,6 +168,14 @@ describe('Wiedervorlage attachments', () => {
.getItem(TEST_FILE_WITH_CONTENT) .getItem(TEST_FILE_WITH_CONTENT)
.getRoot(), .getRoot(),
); );
notExist(
wiedervorlageContainerInVorgang
.getWiedervorlage(WIEDERVORLAGE_WITH_ATTACHMENTS_BETREFF)
.getAttachmentContainer()
.getList()
.getLoadingOrErrorItem(TEST_FILE_WITH_CONTENT_46MB)
.getRoot(),
);
}); });
it('should download empty attachment on click in list', () => { it('should download empty attachment on click in list', () => {
...@@ -233,8 +206,9 @@ describe('Wiedervorlage attachments', () => { ...@@ -233,8 +206,9 @@ describe('Wiedervorlage attachments', () => {
}); });
describe('Delete attachment', () => { describe('Delete attachment', () => {
const wiedervorlageComp: WiedervorlageInVorgangE2EComponent = const wiedervorlageComp: WiedervorlageInVorgangE2EComponent = wiedervorlageContainerInVorgang.getWiedervorlage(
wiedervorlageContainerInVorgang.getWiedervorlage(WIEDERVORLAGE_WITH_ATTACHMENTS_BETREFF); WIEDERVORLAGE_WITH_ATTACHMENTS_BETREFF,
);
it('should open wiedervorlage page', () => { it('should open wiedervorlage page', () => {
wiedervorlageComp.getLink().click(); wiedervorlageComp.getLink().click();
...@@ -256,66 +230,41 @@ describe('Wiedervorlage attachments', () => { ...@@ -256,66 +230,41 @@ describe('Wiedervorlage attachments', () => {
wiedervorlageContainer.getSpeichernButton().click(); wiedervorlageContainer.getSpeichernButton().click();
exist(snackbar.getMessage()); exist(snackbar.getMessage());
contains( contains(snackbar.getMessage(), `Die Wiedervorlage "${WIEDERVORLAGE_WITH_ATTACHMENTS_BETREFF}" wurde gespeichert`);
snackbar.getMessage(),
`Die Wiedervorlage "${WIEDERVORLAGE_WITH_ATTACHMENTS_BETREFF}" wurde gespeichert`,
);
snackbar.getCloseButton().click(); snackbar.getCloseButton().click();
}); });
it('(Skip reason in OZG-4658) check attachments in wiedervorlage list', () => { it('check attachments in wiedervorlage list', () => {
waitForSpinnerToDisappear(); waitForSpinnerToDisappear();
wiedervorlageComp.getExpandButton(); wiedervorlageComp.getExpandButton();
wiedervorlageComp.expandItem(); wiedervorlageComp.expandItem();
notExist( notExist(wiedervorlageComp.getAttachmentContainer().getList().getItem(TEST_FILE_WITHOUT_CONTENT).getRoot());
wiedervorlageComp exist(wiedervorlageComp.getAttachmentContainer().getList().getItem(TEST_FILE_WITH_CONTENT).getRoot());
.getAttachmentContainer()
.getList()
.getItem(TEST_FILE_WITHOUT_CONTENT)
.getRoot(),
);
exist(
wiedervorlageComp
.getAttachmentContainer()
.getList()
.getItem(TEST_FILE_WITH_CONTENT)
.getRoot(),
);
}); });
}); });
describe('switch to wiedervorlage without attachments', () => { describe('switch to wiedervorlage without attachments', () => {
const wiedervorlageComp: WiedervorlageInVorgangE2EComponent = const wiedervorlageComp: WiedervorlageInVorgangE2EComponent = wiedervorlageContainerInVorgang.getWiedervorlage(
wiedervorlageContainerInVorgang.getWiedervorlage(wiedervorlage.betreff); wiedervorlage.betreff,
);
it('should not show any attachments', () => { it('should not show any attachments', () => {
wiedervorlageComp.getLink().click(); wiedervorlageComp.getLink().click();
waitForSpinnerToDisappear(); waitForSpinnerToDisappear();
notExist( notExist(wiedervorlageComp.getAttachmentContainer().getList().getItem(TEST_FILE_WITHOUT_CONTENT).getRoot());
wiedervorlageComp notExist(wiedervorlageComp.getAttachmentContainer().getList().getItem(TEST_FILE_WITH_CONTENT).getRoot());
.getAttachmentContainer()
.getList()
.getItem(TEST_FILE_WITHOUT_CONTENT)
.getRoot(),
);
notExist(
wiedervorlageComp
.getAttachmentContainer()
.getList()
.getItem(TEST_FILE_WITH_CONTENT)
.getRoot(),
);
wiedervorlagePage.getSubnavigation().navigateBack(); wiedervorlagePage.getSubnavigation().navigateBack();
}); });
}); });
describe('Same number of attachments after status change', () => { describe('Same number of attachments after status change', () => {
const wiedervorlageComp: WiedervorlageInVorgangE2EComponent = const wiedervorlageComp: WiedervorlageInVorgangE2EComponent = wiedervorlageContainerInVorgang.getWiedervorlage(
wiedervorlageContainerInVorgang.getWiedervorlage(WIEDERVORLAGE_WITH_ATTACHMENTS_BETREFF); WIEDERVORLAGE_WITH_ATTACHMENTS_BETREFF,
);
it('should open wiedervorlage page', () => { it('should open wiedervorlage page', () => {
wait(500); wait(500);
...@@ -332,10 +281,7 @@ describe('Wiedervorlage attachments', () => { ...@@ -332,10 +281,7 @@ describe('Wiedervorlage attachments', () => {
waitForSpinnerToDisappear(); waitForSpinnerToDisappear();
containClass(wiedervorlageContainer.getStatusDot(), 'erledigt'); containClass(wiedervorlageContainer.getStatusDot(), 'erledigt');
contains( contains(snackBar.getMessage(), `Die Wiedervorlage ${WIEDERVORLAGE_WITH_ATTACHMENTS_BETREFF} wurde erledigt`);
snackBar.getMessage(),
`Die Wiedervorlage ${WIEDERVORLAGE_WITH_ATTACHMENTS_BETREFF} wurde erledigt`,
);
}); });
it('should close snackBar on close', () => { it('should close snackBar on close', () => {
...@@ -350,10 +296,7 @@ describe('Wiedervorlage attachments', () => { ...@@ -350,10 +296,7 @@ describe('Wiedervorlage attachments', () => {
waitForSpinnerToDisappear(); waitForSpinnerToDisappear();
notContainClass(wiedervorlageContainer.getStatusDot(), 'erledigt'); notContainClass(wiedervorlageContainer.getStatusDot(), 'erledigt');
contains( contains(snackBar.getMessage(), `Die Wiedervorlage ${WIEDERVORLAGE_WITH_ATTACHMENTS_BETREFF} wurde wiedereröffnet`);
snackBar.getMessage(),
`Die Wiedervorlage ${WIEDERVORLAGE_WITH_ATTACHMENTS_BETREFF} wurde wiedereröffnet`,
);
}); });
it('should close snackBar on close', () => { it('should close snackBar on close', () => {
...@@ -385,10 +328,7 @@ describe('Wiedervorlage attachments', () => { ...@@ -385,10 +328,7 @@ describe('Wiedervorlage attachments', () => {
waitForSpinnerToDisappear(); waitForSpinnerToDisappear();
exist(snackbar.getMessage()); exist(snackbar.getMessage());
contains( contains(snackbar.getMessage(), `Die Wiedervorlage "${WIEDERVORLAGE_WITH_ATTACHMENTS_BETREFF}" wurde gespeichert`);
snackbar.getMessage(),
`Die Wiedervorlage "${WIEDERVORLAGE_WITH_ATTACHMENTS_BETREFF}" wurde gespeichert`,
);
}); });
it('should close snackBar on close', () => { it('should close snackBar on close', () => {
...@@ -398,26 +338,15 @@ describe('Wiedervorlage attachments', () => { ...@@ -398,26 +338,15 @@ describe('Wiedervorlage attachments', () => {
}); });
it('(Skip reason in OZG-4658) should have no attachments after save', () => { it('(Skip reason in OZG-4658) should have no attachments after save', () => {
const wiedervorlageComp: WiedervorlageInVorgangE2EComponent = const wiedervorlageComp: WiedervorlageInVorgangE2EComponent = wiedervorlageContainerInVorgang.getWiedervorlage(
wiedervorlageContainerInVorgang.getWiedervorlage(WIEDERVORLAGE_WITH_ATTACHMENTS_BETREFF); WIEDERVORLAGE_WITH_ATTACHMENTS_BETREFF,
);
wiedervorlageComp.getExpandButton(); wiedervorlageComp.getExpandButton();
wiedervorlageComp.expandItem(); wiedervorlageComp.expandItem();
notExist( notExist(wiedervorlageComp.getAttachmentContainer().getList().getItem(TEST_FILE_WITHOUT_CONTENT).getRoot());
wiedervorlageComp notExist(wiedervorlageComp.getAttachmentContainer().getList().getItem(TEST_FILE_WITH_CONTENT).getRoot());
.getAttachmentContainer()
.getList()
.getItem(TEST_FILE_WITHOUT_CONTENT)
.getRoot(),
);
notExist(
wiedervorlageComp
.getAttachmentContainer()
.getList()
.getItem(TEST_FILE_WITH_CONTENT)
.getRoot(),
);
}); });
}); });
}); });
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
[errorMessages]="uploadFile.uploadedFile.error | convertProblemDetailToErrorMessages" [errorMessages]="uploadFile.uploadedFile.error | convertProblemDetailToErrorMessages"
description="Anhang wird hochgeladen" description="Anhang wird hochgeladen"
[isLoading]="uploadFile.uploadedFile.loading" [isLoading]="uploadFile.uploadedFile.loading"
data-test-id="file-upload-list-item-attachment-upload" [attr.data-test-id]="(uploadFile.fileToUpload.name | convertForDataTest) + '-file-upload-list-item-attachment-upload'"
></ods-attachment> ></ods-attachment>
} @else if (uploadFile.uploadedFile.resource) { } @else if (uploadFile.uploadedFile.resource) {
<ods-attachment-wrapper> <ods-attachment-wrapper>
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
[file]="uploadFile.uploadedFile.resource" [file]="uploadFile.uploadedFile.resource"
[deletable]="true" [deletable]="true"
(startDelete)="delete.emit({ key, binaryFileResource: $event })" (startDelete)="delete.emit({ key, binaryFileResource: $event })"
data-test-id="file-upload-list-item-uploaded" [attr.data-test-id]="(uploadFile.uploadedFile.resource.name | convertForDataTest) + '-file-upload-list-item-uploaded'"
> >
</alfa-binary-file2-container> </alfa-binary-file2-container>
</ods-attachment-wrapper> </ods-attachment-wrapper>
......
...@@ -29,8 +29,10 @@ describe('FileUploadListItemComponent', () => { ...@@ -29,8 +29,10 @@ describe('FileUploadListItemComponent', () => {
let component: FileUploadListItemComponent; let component: FileUploadListItemComponent;
let fixture: ComponentFixture<FileUploadListItemComponent>; let fixture: ComponentFixture<FileUploadListItemComponent>;
const attachmentTestId: string = getDataTestIdOf('file-upload-list-item-attachment-upload'); const file: File = createFile();
const binaryFileContainerTestId: string = getDataTestIdOf('file-upload-list-item-uploaded'); const binaryFileResource: BinaryFileResource = createBinaryFileResource();
const attachmentTestId: string = getDataTestIdOf(file.name + '-file-upload-list-item-attachment-upload');
const binaryFileContainerTestId: string = getDataTestIdOf(binaryFileResource.name + '-file-upload-list-item-uploaded');
beforeEach(async () => { beforeEach(async () => {
await TestBed.configureTestingModule({ await TestBed.configureTestingModule({
...@@ -50,8 +52,6 @@ describe('FileUploadListItemComponent', () => { ...@@ -50,8 +52,6 @@ describe('FileUploadListItemComponent', () => {
}); });
describe('template', () => { describe('template', () => {
const file: File = createFile();
beforeEach(() => { beforeEach(() => {
component.uploadFile.fileToUpload = file; component.uploadFile.fileToUpload = file;
}); });
...@@ -74,7 +74,7 @@ describe('FileUploadListItemComponent', () => { ...@@ -74,7 +74,7 @@ describe('FileUploadListItemComponent', () => {
}); });
it('should NOT exists on loaded', () => { it('should NOT exists on loaded', () => {
component.uploadFile.uploadedFile = createStateResource(createBinaryFileResource()); component.uploadFile.uploadedFile = createStateResource(binaryFileResource);
fixture.detectChanges(); fixture.detectChanges();
...@@ -82,7 +82,7 @@ describe('FileUploadListItemComponent', () => { ...@@ -82,7 +82,7 @@ describe('FileUploadListItemComponent', () => {
}); });
it('should have inputs', () => { it('should have inputs', () => {
component.uploadFile.fileToUpload = createFile(); component.uploadFile.fileToUpload = file;
component.uploadFile.uploadedFile = createEmptyStateResource(true); component.uploadFile.uploadedFile = createEmptyStateResource(true);
fixture.detectChanges(); fixture.detectChanges();
...@@ -97,7 +97,7 @@ describe('FileUploadListItemComponent', () => { ...@@ -97,7 +97,7 @@ describe('FileUploadListItemComponent', () => {
describe('uploaded file', () => { describe('uploaded file', () => {
it('should exists', () => { it('should exists', () => {
component.uploadFile.uploadedFile = createStateResource(createBinaryFileResource()); component.uploadFile.uploadedFile = createStateResource(binaryFileResource);
fixture.detectChanges(); fixture.detectChanges();
...@@ -113,7 +113,7 @@ describe('FileUploadListItemComponent', () => { ...@@ -113,7 +113,7 @@ describe('FileUploadListItemComponent', () => {
}); });
it('should have inputs', () => { it('should have inputs', () => {
component.uploadFile.uploadedFile = createStateResource(createBinaryFileResource()); component.uploadFile.uploadedFile = createStateResource(binaryFileResource);
fixture.detectChanges(); fixture.detectChanges();
...@@ -131,7 +131,6 @@ describe('FileUploadListItemComponent', () => { ...@@ -131,7 +131,6 @@ describe('FileUploadListItemComponent', () => {
it('should emit', () => { it('should emit', () => {
component.delete.emit = jest.fn(); component.delete.emit = jest.fn();
component.key = 'test'; component.key = 'test';
const binaryFileResource: BinaryFileResource = createBinaryFileResource();
component.uploadFile.uploadedFile = createStateResource(binaryFileResource); component.uploadFile.uploadedFile = createStateResource(binaryFileResource);
fixture.detectChanges(); fixture.detectChanges();
......
import { BinaryFileModule } from '@alfa-client/binary-file'; import { BinaryFileModule } from '@alfa-client/binary-file';
import { FileToDelete, UploadFile } from '@alfa-client/binary-file-shared'; import { FileToDelete, UploadFile } from '@alfa-client/binary-file-shared';
import { ConvertProblemDetailToErrorMessagesPipe } from '@alfa-client/tech-shared'; import { ConvertForDataTestPipe, ConvertProblemDetailToErrorMessagesPipe } from '@alfa-client/tech-shared';
import { Component, EventEmitter, Input, Output } from '@angular/core'; import { Component, EventEmitter, Input, Output } from '@angular/core';
import { AttachmentComponent, AttachmentWrapperComponent } from '@ods/system'; import { AttachmentComponent, AttachmentWrapperComponent } from '@ods/system';
...@@ -8,7 +8,13 @@ import { AttachmentComponent, AttachmentWrapperComponent } from '@ods/system'; ...@@ -8,7 +8,13 @@ import { AttachmentComponent, AttachmentWrapperComponent } from '@ods/system';
selector: 'ods-file-upload-list-item', selector: 'ods-file-upload-list-item',
standalone: true, standalone: true,
templateUrl: './file-upload-list-item.component.html', templateUrl: './file-upload-list-item.component.html',
imports: [AttachmentComponent, AttachmentWrapperComponent, BinaryFileModule, ConvertProblemDetailToErrorMessagesPipe], imports: [
AttachmentComponent,
AttachmentWrapperComponent,
BinaryFileModule,
ConvertProblemDetailToErrorMessagesPipe,
ConvertForDataTestPipe,
],
}) })
export class FileUploadListItemComponent { export class FileUploadListItemComponent {
@Input() key: string; @Input() key: string;
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
[fileUploadType]="fileUploadType" [fileUploadType]="fileUploadType"
[filesResource]="filesResource" [filesResource]="filesResource"
[filesLinkRel]="filesLinkRelation" [filesLinkRel]="filesLinkRelation"
data-test-id="multi-file-upload-list" data-test-id="file-list"
></ods-file-upload-list-container> ></ods-file-upload-list-container>
<ods-multi-file-upload-editor <ods-multi-file-upload-editor
[fileUploadType]="fileUploadType" [fileUploadType]="fileUploadType"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment