From d09cf8c1b0c34dc5f36c97b258fb2993de2269df Mon Sep 17 00:00:00 2001
From: OZGCloud <ozgcloud@mgm-tp.com>
Date: Sun, 22 Jan 2023 12:30:39 +0100
Subject: [PATCH] OZG-770 add e2e test for download uploaded Kommentar
 attachments

---
 .../kommentar-attachment.e2e-spec.ts          | 23 ++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)

diff --git a/goofy-client/apps/goofy-e2e/src/integration/main-tests/kommentar-attachment/kommentar-attachment.e2e-spec.ts b/goofy-client/apps/goofy-e2e/src/integration/main-tests/kommentar-attachment/kommentar-attachment.e2e-spec.ts
index 7dc5e03885..aae9ce6f00 100644
--- a/goofy-client/apps/goofy-e2e/src/integration/main-tests/kommentar-attachment/kommentar-attachment.e2e-spec.ts
+++ b/goofy-client/apps/goofy-e2e/src/integration/main-tests/kommentar-attachment/kommentar-attachment.e2e-spec.ts
@@ -26,7 +26,7 @@ import { UserE2E } from '../../../model/user';
 import { VorgangE2E } from '../../../model/vorgang';
 import { MainPage, waitForSpinnerToDisappear } from '../../../page-objects/main.po';
 import { VorgangPage } from '../../../page-objects/vorgang.po';
-import { dropCollections } from '../../../support/cypress-helper';
+import { dropCollections, readFileFromDownloads } from '../../../support/cypress-helper';
 import { exist, notExist } from '../../../support/cypress.util';
 import { getUserSabine, loginAsSabine } from '../../../support/user-util';
 import { createVorgang, initVorgang } from '../../../support/vorgang-util';
@@ -121,4 +121,25 @@ describe('Kommentar attachments', () => {
 			notExist(attachmentList.getItem(TEST_FILE_WITHOUT_CONTENT).getRoot());
 		});
 	});
+
+	describe('Download Kommentar attachments', () => {
+		it('should upload attachment', () => {
+			kommentarContainer.getRoot().click();
+			uploadFile(attachmentContainer.getUploadInput(), TEST_FILE_WITH_CONTENT);
+			waitForSpinnerToDisappear();
+
+			kommentarContainer.getFormularSpeichernButton().click();
+			waitForSpinnerToDisappear();
+
+			exist(attachmentList.getItem(TEST_FILE_WITH_CONTENT).getRoot());
+		});
+
+		it('should download uploaded attachment', () => {
+			attachmentList.getItem(TEST_FILE_WITH_CONTENT).getDownloadButton().click();
+			waitForSpinnerToDisappear();
+
+			exist(readFileFromDownloads(TEST_FILE_WITH_CONTENT));
+		});
+	});
+
 });
-- 
GitLab