From a1e464a2c759e44b6ed541fa4b70d090686ea514 Mon Sep 17 00:00:00 2001 From: Patrick Peinan Wang <144158754+patrickpeinanw@users.noreply.github.com> Date: Mon, 6 Jan 2025 15:25:50 -0800 Subject: [PATCH] 24458 - no expansion panel for pending correction filing in the todo section (#110) --- cypress/e2e/components/todos/pending.cy.ts | 18 ++++++++ cypress/fixtures/todos/pendingCorrection.json | 42 +++++++++++++++++++ src/utils/todo/task-filing/content-loader.ts | 3 +- 3 files changed, 61 insertions(+), 2 deletions(-) create mode 100644 cypress/fixtures/todos/pendingCorrection.json diff --git a/cypress/e2e/components/todos/pending.cy.ts b/cypress/e2e/components/todos/pending.cy.ts index a2ea88ab..87b1cecc 100644 --- a/cypress/e2e/components/todos/pending.cy.ts +++ b/cypress/e2e/components/todos/pending.cy.ts @@ -174,4 +174,22 @@ context('TODOs -> Pending Filing', () => { .eq(0).click() .wait('@cancelPayment') }) + + it('Paid and pending correction', () => { + cy.visitBusinessDashFor('businessInfo/ben/active.json', undefined, false, false, 'pendingCorrection.json') + + cy.get('[data-cy="header_todo"]').should('exist') + cy.get('[data-cy="todoItemList"]').should('exist') + + // subtitle + cy.get('[data-cy^="todoItem-label-"]') + .should('exist') + .should('contains.text', 'FILING PENDING') + + // no 'View Details' button + cy.get('[data-cy^="todoItem-showMore-"]').should('not.exist') + + // no action button + cy.get('[data-cy^="todoItemActions-"]').find('button').should('not.exist') + }) }) diff --git a/cypress/fixtures/todos/pendingCorrection.json b/cypress/fixtures/todos/pendingCorrection.json new file mode 100644 index 00000000..7dda14f3 --- /dev/null +++ b/cypress/fixtures/todos/pendingCorrection.json @@ -0,0 +1,42 @@ +{ + "tasks": [ + { + "enabled": true, + "order": 1, + "task": { + "filing": { + "business": { + "foundingDate": "2024-10-12T00:27:29.366345+00:00", + "identifier": "BC0883617", + "legalName": "0883617 B.C. LTD.", + "legalType": "BC" + }, + "correction": { + "correctedFilingType": "incorporationApplication" + }, + "header": { + "affectedFilings": [], + "availableOnPaperOnly": false, + "certifiedBy": "", + "colinIds": [], + "comments": [], + "date": "2024-12-11T21:51:10.469453+00:00", + "deletionLocked": false, + "effectiveDate": "2024-12-11T21:51:10.469477+00:00", + "filingId": 155015, + "folioNumber": "", + "inColinOnly": false, + "isCorrected": false, + "isCorrectionPending": false, + "name": "correction", + "priority": false, + "paymentStatusCode": "COMPLETED", + "status": "PENDING", + "submitter": "pewang@idir", + "waiveFees": true + } + } + } + } + ] +} diff --git a/src/utils/todo/task-filing/content-loader.ts b/src/utils/todo/task-filing/content-loader.ts index a4a9f806..cecedac9 100644 --- a/src/utils/todo/task-filing/content-loader.ts +++ b/src/utils/todo/task-filing/content-loader.ts @@ -183,8 +183,7 @@ export const addExpansionContent = (todoItem: TodoItemI): void => { // if it is a draft correction filing todoItem.expansionContent = TodoExpansionContentE.DRAFT_CORRECTION } else if (todoItem.name === FilingTypes.CORRECTION) { - // if it is a correction filing (non-draft) - todoItem.expansionContent = TodoExpansionContentE.CORRECTION + // if it is a non-draft correction filing (pending filing), no expansion panel in this case } else if ( (todoItem.status === FilingStatusE.DRAFT || todoItem.status === FilingStatusE.APPROVED) && todoItem.nameRequest ) {