From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Fri, 17 Mar 2023 06:41:34 +0000 (-0700) Subject: Frontend testing for new comment UI features X-Git-Tag: v1.14.0-beta.rc1~33^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=727fb38bafad7972e6ec5e8115fec2531ed7a766;p=thirdparty%2Fpaperless-ngx.git Frontend testing for new comment UI features --- diff --git a/src-ui/cypress/e2e/documents/document-detail.cy.ts b/src-ui/cypress/e2e/documents/document-detail.cy.ts index 0cacbd81f6..8f6d8bde97 100644 --- a/src-ui/cypress/e2e/documents/document-detail.cy.ts +++ b/src-ui/cypress/e2e/documents/document-detail.cy.ts @@ -104,4 +104,19 @@ describe('document-detail', () => { cy.get('app-document-comments').find('form button').click().wait(1500) cy.get('app-document-comments').find('.card').its('length').should('eq', 4) }) + + it('should support navigation to comments tab by url', () => { + cy.visit('/documents/1/comments') + cy.get('app-document-comments').should('exist') + }) + + it('should dynamically update comment counts', () => { + cy.visit('/documents/1/comments') + cy.get('app-document-comments').within(() => cy.contains('Delete').click()) + cy.get('ul.nav') + .find('li') + .contains('Comments') + .find('.badge') + .contains('2') + }) }) diff --git a/src-ui/cypress/fixtures/documents/documents.json b/src-ui/cypress/fixtures/documents/documents.json index e7275b4b5d..715ac8e165 100644 --- a/src-ui/cypress/fixtures/documents/documents.json +++ b/src-ui/cypress/fixtures/documents/documents.json @@ -21,7 +21,8 @@ "original_file_name": "2022-03-22 no latin title.pdf", "archived_file_name": "2022-03-22 no latin title.pdf", "owner": null, - "permissions": [] + "permissions": [], + "n_comments": 3 }, { "id": 2, @@ -39,7 +40,8 @@ "original_file_name": "2022-03-23 lorem ipsum dolor sit amet.pdf", "archived_file_name": "2022-03-23 llorem ipsum dolor sit amet.pdf", "owner": null, - "permissions": [] + "permissions": [], + "n_comments": 0 }, { "id": 3, @@ -59,7 +61,8 @@ "original_file_name": "2022-03-24 dolor.pdf", "archived_file_name": "2022-03-24 dolor.pdf", "owner": null, - "permissions": [] + "permissions": [], + "n_comments": 0 }, { "id": 4, @@ -79,7 +82,8 @@ "original_file_name": "2022-06-01 sit amet.pdf", "archived_file_name": "2022-06-01 sit amet.pdf", "owner": null, - "permissions": [] + "permissions": [], + "n_comments": 0 } ] }