Skip to content

Commit

Permalink
23439; 23197 - Bug fixing (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
hfekete authored Oct 9, 2024
1 parent 9d41e70 commit f025d32
Show file tree
Hide file tree
Showing 4 changed files with 89 additions and 7 deletions.
23 changes: 22 additions & 1 deletion cypress/e2e/components/filings/section.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { allFilings } from '../../../fixtures/filings/allFilings'
import { directorChange } from '../../../fixtures/filings/directorChange/directorChange'
import { administrativeDissolution } from '../../../fixtures/filings/dissolution/administrativeDissolution'
import { courtOrder } from '../../../fixtures/filings/staffFiling/courtOrder'
import { adminFreeze, adminFreezeWithDisplayLedgerTrue } from '../../../fixtures/filings/staffFiling/adminFreeze'

context('Filings history section', () => {
it('Verifies filing history is displayed, and it shows data', () => {
Expand Down Expand Up @@ -113,7 +114,7 @@ context('Filings history section', () => {
cy.visitBusinessDashFor('businessInfo/cc/withCourtOrder.json', undefined, false, false, undefined, filings)

// verify notification
cy.get('[data-cy="hasCourtOrdersNotificationCard"').should('exist')
cy.get('[data-cy="hasCourtOrdersNotificationCard"]').should('exist')

// expand filing
cy.get(`[data-cy="filingHistoryItem-staff-filing-${courtOrder.filingId}"]`)
Expand All @@ -125,4 +126,24 @@ context('Filings history section', () => {
cy.get(`[data-cy="filingHistoryItem-staff-filing-${courtOrder.filingId}"]`)
.contains(`Court Order Number: ${courtOrder.data.order.fileNumber}`)
})

it('Verifies that admin freeze is not displayed (when it has displayLedger set to false)', () => {
const filings = [courtOrder, courtOrder, adminFreeze]
cy.visitBusinessDashFor('businessInfo/cc/withCourtOrder.json', undefined, false, false, undefined, filings)

// verify we cant see admin freeze
cy.contains('Admin Freeze').should('not.exist')

cy.get('[data-cy*="filingHistoryItem-staff"]').should('have.length', 2)
})

it('Verifies that admin unfreeze is displayed when it has displayLedger set to true', () => {
const filings = [adminFreeze, adminFreezeWithDisplayLedgerTrue]
cy.visitBusinessDashFor('businessInfo/cc/withCourtOrder.json', undefined, false, false, undefined, filings)

// verify we cant see admin freeze
cy.contains('Admin Freeze').should('exist')

cy.get('[data-cy*="filingHistoryItem-staff"]').should('have.length', 1)
})
})
59 changes: 59 additions & 0 deletions cypress/fixtures/filings/staffFiling/adminFreeze.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
export const adminFreeze = {
availableOnPaperOnly: false,
businessIdentifier: 'CP1002605',
commentsCount: 0,
commentsLink:
'https://legal-api-dev.apps.silver.devops.gov.bc.ca/api/v2/businesses/CP1002605/filings/151402/comments',
data: {
adminFreeze: {
freeze: false
},
applicationDate: '2024-10-08T00:23:55.027171+00:00',
legalFilings: [
'adminFreeze'
]
},
displayLedger: false,
displayName: 'Admin Freeze',
documentsLink:
'https://legal-api-dev.apps.silver.devops.gov.bc.ca/api/v2/businesses/CP1002605/filings/151402/documents',
effectiveDate: 'Tue, 08 Oct 2024 00:23:56 GMT',
filingId: 151402,
filingLink: 'https://legal-api-dev.apps.silver.devops.gov.bc.ca/api/v2/businesses/CP1002605/filings/151402',
isFutureEffective: false,
name: 'adminFreeze',
paymentStatusCode: 'COMPLETED',
status: 'COMPLETED',
submittedDate: 'Tue, 08 Oct 2024 00:23:55 GMT',
submitter: 'Registry Staff'
}

export const adminFreezeWithDisplayLedgerTrue = {
availableOnPaperOnly: false,
businessIdentifier: 'CP1002605',
commentsCount: 0,
commentsLink:
'https://legal-api-dev.apps.silver.devops.gov.bc.ca/api/v2/businesses/CP1002605/filings/151402/comments',
data: {
adminFreeze: {
freeze: false
},
applicationDate: '2024-10-08T00:22:55.027171+00:00',
legalFilings: [
'adminFreeze'
]
},
displayLedger: true,
displayName: 'Admin Freeze',
documentsLink:
'https://legal-api-dev.apps.silver.devops.gov.bc.ca/api/v2/businesses/CP1002605/filings/151402/documents',
effectiveDate: 'Tue, 08 Oct 2024 00:23:56 GMT',
filingId: 151402,
filingLink: 'https://legal-api-dev.apps.silver.devops.gov.bc.ca/api/v2/businesses/CP1002605/filings/151402',
isFutureEffective: false,
name: 'adminFreeze',
paymentStatusCode: 'COMPLETED',
status: 'COMPLETED',
submittedDate: 'Tue, 08 Oct 2024 00:23:55 GMT',
submitter: 'Registry Staff'
}
13 changes: 7 additions & 6 deletions src/components/bcros/filing/List.vue
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,13 @@ const filingComponent = (filing: ApiResponseFilingI): Component => {
<span class="ml-1 text-base">{{ $t('text.filing.courtOrder.hasCourtOrders') }}</span>
</div>

<Component
:is="filingComponent(filing)"
v-for="filing in filings"
:key="filing.filingId"
:filing="filing"
/>
<template v-for="filing in filings" :key="filing.filingId">
<Component
:is="filingComponent(filing)"
v-if="filing.displayLedger"
:filing="filing"
/>
</template>

<div v-if="filings.length === 0" class="flex flex-col w-full bg-white p-5 rounded">
<div data-cy="business-filing-history-empty">
Expand Down
1 change: 1 addition & 0 deletions src/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@
"CP": "BC Cooperative Association",
"SP": "BC Sole Proprietorship",
"GP": "BC General Partnership",
"ULC": "BC Unlimited Liability Company",
"undefined": "N/A"
}
},
Expand Down

0 comments on commit f025d32

Please sign in to comment.