From f97483e194c6a35d11ae1ef4c1c01e9d53d8b14b Mon Sep 17 00:00:00 2001 From: Dominik Bruhn Date: Fri, 7 Jun 2024 17:21:57 +0200 Subject: [PATCH] Add UI Test with Delete Originals enabled --- .../bulk-editor/bulk-editor.component.spec.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src-ui/src/app/components/document-list/bulk-editor/bulk-editor.component.spec.ts b/src-ui/src/app/components/document-list/bulk-editor/bulk-editor.component.spec.ts index 8587095c1..cbc8cc4bf 100644 --- a/src-ui/src/app/components/document-list/bulk-editor/bulk-editor.component.spec.ts +++ b/src-ui/src/app/components/document-list/bulk-editor/bulk-editor.component.spec.ts @@ -1056,6 +1056,25 @@ describe('BulkEditorComponent', () => { httpTestingController.match( `${environment.apiBaseUrl}documents/?page=1&page_size=100000&fields=id` ) // listAllFilteredIds + + // Test with Delete Originals enabled + modal.componentInstance.deleteOriginals = true + modal.componentInstance.confirm() + req = httpTestingController.expectOne( + `${environment.apiBaseUrl}documents/bulk_edit/` + ) + req.flush(true) + expect(req.request.body).toEqual({ + documents: [3, 4], + method: 'merge', + parameters: { metadata_document_id: 3, delete_originals: true }, + }) + httpTestingController.match( + `${environment.apiBaseUrl}documents/?page=1&page_size=50&ordering=-created&truncate_content=true` + ) // list reload + httpTestingController.match( + `${environment.apiBaseUrl}documents/?page=1&page_size=100000&fields=id` + ) // listAllFilteredIds }) it('should support bulk download with archive, originals or both and file formatting', () => {