]> git.ipfire.org Git - thirdparty/paperless-ngx.git/commitdiff
Frontend testing for new comment UI features
authorshamoon <4887959+shamoon@users.noreply.github.com>
Fri, 17 Mar 2023 06:41:34 +0000 (23:41 -0700)
committershamoon <4887959+shamoon@users.noreply.github.com>
Sat, 18 Mar 2023 01:47:03 +0000 (18:47 -0700)
src-ui/cypress/e2e/documents/document-detail.cy.ts
src-ui/cypress/fixtures/documents/documents.json

index 0cacbd81f6c3ba328066416c60585c414390ff02..8f6d8bde971a0c1c7878c1f5cd6097f1d0da53f4 100644 (file)
@@ -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')
+  })
 })
index e7275b4b5d5b444b860ff9b7034357ba41ea8309..715ac8e16542a7396dba960adc2b7447164a3e1e 100644 (file)
@@ -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
         }
     ]
 }