From 1a83a3aacf81121ad0150cf8bd1bd149b84dec70 Mon Sep 17 00:00:00 2001 From: Hrvoje Fekete Date: Fri, 2 Aug 2024 01:08:24 -0700 Subject: [PATCH 1/4] 21802 - Add details call and list. --- cypress/e2e/components/filings/section.cy.ts | 20 +++++++- .../filings/directorChange/commentList.json | 24 +++++++++ .../filings/directorChange/directorChange.ts | 2 +- .../bcros/filing/CommonTemplate.vue | 44 ++++++++-------- .../bcros/filing/common/DetailsList.vue | 39 ++++++++------- .../bcros/filing/common/DocumentsList.vue | 50 +++++++++++-------- src/utils/filings.ts | 46 +++++++++++++++++ 7 files changed, 163 insertions(+), 62 deletions(-) create mode 100644 cypress/fixtures/filings/directorChange/commentList.json diff --git a/cypress/e2e/components/filings/section.cy.ts b/cypress/e2e/components/filings/section.cy.ts index b1a3be3..5be2347 100644 --- a/cypress/e2e/components/filings/section.cy.ts +++ b/cypress/e2e/components/filings/section.cy.ts @@ -13,7 +13,7 @@ context('Filings history section', () => { }) }) - it('Verifies body of the filings', () => { + it('Verifies body of the filings -- document list, court number', () => { // director change verification aka, verify body list const filings = [directorChange, administrativeDissolution] cy.visitBusinessDashFor('businessInfo/ben/active.json', undefined, false, undefined, filings) @@ -74,4 +74,22 @@ context('Filings history section', () => { .find('[data-cy="pursuant-to-a-plan"]') .should('not.exist') }) + + it('Verifies body of the filings -- details (comments)', () => { + const filings = [directorChange, administrativeDissolution] + cy.visitBusinessDashFor('businessInfo/ben/active.json', undefined, false, undefined, filings) + + cy.fixture('filings/directorChange/documentList.json').then((response) => { + cy.intercept( + 'GET', + `**/api/v2/businesses/**/filings/${directorChange.filingId}/comments`, + response).as('detailsList') + }) + + // expand filing + cy.get(`[data-cy="filingHistoryItem-default-filing-${directorChange.filingId}"]`) + .find('[data-cy="filing-main-action-button"]') + .click() + + }) }) diff --git a/cypress/fixtures/filings/directorChange/commentList.json b/cypress/fixtures/filings/directorChange/commentList.json new file mode 100644 index 0000000..d6eb46c --- /dev/null +++ b/cypress/fixtures/filings/directorChange/commentList.json @@ -0,0 +1,24 @@ +{ + "comments": [ + { + "comment": { + "businessId": null, + "comment": "this is another comment... test 123", + "filingId": 150006, + "id": 620860, + "submitterDisplayName": "Business Registry Test 1", + "timestamp": "2024-08-02T05:14:39.403319+00:00" + } + }, + { + "comment": { + "businessId": null, + "comment": "Test adding STAFF comments ", + "filingId": 150006, + "id": 620671, + "submitterDisplayName": "Business Registry Test 1", + "timestamp": "2024-07-29T17:36:29.851567+00:00" + } + } + ] +} diff --git a/cypress/fixtures/filings/directorChange/directorChange.ts b/cypress/fixtures/filings/directorChange/directorChange.ts index 140ada1..691d6f9 100644 --- a/cypress/fixtures/filings/directorChange/directorChange.ts +++ b/cypress/fixtures/filings/directorChange/directorChange.ts @@ -1,7 +1,7 @@ export const directorChange = { availableOnPaperOnly: false, businessIdentifier: 'CP1002605', - commentsCount: 0, + commentsCount: 2, commentsLink: 'https://legal-api-dev.apps.silver.devops.gov.bc.ca/api/v2/businesses/CP1002605/filings/150006/comments', data: { diff --git a/src/components/bcros/filing/CommonTemplate.vue b/src/components/bcros/filing/CommonTemplate.vue index 9f460ca..d506d88 100644 --- a/src/components/bcros/filing/CommonTemplate.vue +++ b/src/components/bcros/filing/CommonTemplate.vue @@ -1,5 +1,5 @@