Skip to content

Commit

Permalink
Fix change buttons in side accordions (#63)
Browse files Browse the repository at this point in the history
* Fix logic for change buttons in side accordions

* bootstrap business always have disabled change buttons in side accordions

* update

* fix label text for mailing address
patrickpeinanw authored Nov 8, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 27d1f1a commit 3f3a0b0
Showing 5 changed files with 229 additions and 46 deletions.
10 changes: 10 additions & 0 deletions cypress/e2e/components/addresses.cy.ts
Original file line number Diff line number Diff line change
@@ -59,4 +59,14 @@ context('Business dashboard -> Address side component', () => {
// cy.get('[data-cy="address-change-button"]').click()
// cy.get('[data-cy="continue-to-coa-button"]').should('not.exist')
// })

it('Change button does not exist for historical businesses', () => {
cy.visitBusinessDashFor('businessInfo/bc/historical.json')
cy.get('[data-cy="address-change-button"]').should('not.exist')
})

it('Change button is disabled when \'changeOfAddress\' is not in allowable actions', () => {
cy.visitBusinessDashFor('businessInfo/ben/unable-to-change-address-and-party.json')
cy.get('[data-cy="address-change-button"]').should('be.disabled')
})
})
54 changes: 45 additions & 9 deletions cypress/e2e/components/directors-partners-proprietors.cy.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,55 @@
context('Business dashboard -> Side components: Current Directors, Partners, Proprietors', () => {
it('Directors accordion is rendered', () => {
cy.visitBusinessDash('BC0871427', 'BEN')
cy.get('[data-cy="accordion_directors"]').should('exist')
cy.get('[data-cy="accordion_directors"]').children().eq(0).children().should('have.length', 5)
cy.visitBusinessDashFor('businessInfo/ben/active.json')
cy.get('[data-cy="accordion_directors"]')
.should('exist')
.children().eq(0).children()
.should('have.length', 5)
.get('[data-cy="header_directors"]')
.should('contain', 'Current Directors')

cy.intercept('GET', '**/BC**/standalone-directors**').as('changeDirector')
cy.get('[data-cy="change-button"]')
.should('exist')
.click()
.wait('@changeDirector')
})

it('Partners accordion is rendered', () => {
cy.visitBusinessDash('FM1060265', 'GP')
cy.get('[data-cy="accordion_partners"]').should('exist')
cy.get('[data-cy="accordion_partners"]').children().eq(0).children().should('have.length', 3)
cy.visitBusinessDashFor('businessInfo/gp/active.json')
cy.get('[data-cy="accordion_partners"]')
.should('exist')
.children().eq(0).children()
.should('have.length', 3)
.get('[data-cy="header_partner"]')
.should('contain', 'Partners')

cy.intercept('GET', '**/FM**/change**').as('changePartner')
cy.get('[data-cy="change-button"]').should('exist').click()
cy.wait('@changePartner')
})

it('Proprietors accordion is rendered', () => {
cy.visitBusinessDash('FM1060270', 'SP')
cy.get('[data-cy="accordion_proprietors"]').should('exist')
cy.get('[data-cy="accordion_proprietors"]').children().eq(0).children().should('have.length', 1)
cy.visitBusinessDashFor('businessInfo/sp/active.json')
cy.get('[data-cy="accordion_proprietors"]')
.should('exist')
.children().eq(0).children()
.should('have.length', 1)
.get('[data-cy="header_proprietors"]')
.should('contain', 'Proprietors')

cy.intercept('GET', '**/FM**/change**').as('changeProprietor')
cy.get('[data-cy="change-button"]').should('exist').click()
cy.wait('@changeProprietor')
})

it('Change button does not exist for historical businesses', () => {
cy.visitBusinessDashFor('businessInfo/bc/historical.json')
cy.get('[data-cy="change-button"]').should('not.exist')
})

it('Change button is disabled when \'changeOfDirector\' is not in allowable actions', () => {
cy.visitBusinessDashFor('businessInfo/ben/unable-to-change-address-and-party.json')
cy.get('[data-cy="change-button"]').should('be.disabled')
})
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
{
"business": {
"adminFreeze": false,
"allowedActions": {
"digitalBusinessCard": false,
"filing": {
"filingSubmissionLink": "https://legal-api-dev.apps.silver.devops.gov.bc.ca/api/v2/BC0871427/filings",
"filingTypes": [
{
"displayName": "Admin Freeze",
"feeCode": "NOFEE",
"name": "adminFreeze"
},
{
"displayName": "Request for AGM Extension",
"feeCode": "AGMDT",
"name": "agmExtension"
},
{
"displayName": "AGM Location Change",
"feeCode": "AGMLC",
"name": "agmLocationChange"
},
{
"displayName": "Alteration",
"feeCode": "ALTER",
"name": "alteration"
},
{
"displayName": "Amalgamation Application (Regular)",
"feeCode": "AMALR",
"name": "amalgamationApplication",
"type": "regular"
},
{
"displayName": "Amalgamation Application Short-form (Vertical)",
"feeCode": "AMALV",
"name": "amalgamationApplication",
"type": "vertical"
},
{
"displayName": "Amalgamation Application Short-form (Horizontal)",
"feeCode": "AMALH",
"name": "amalgamationApplication",
"type": "horizontal"
},
{
"displayName": "Annual Report",
"feeCode": "BCANN",
"name": "annualReport"
},
{
"displayName": "6-Month Consent to Continue Out",
"feeCode": "CONTO",
"name": "consentContinuationOut"
},
{
"displayName": "Register Correction Application",
"feeCode": "CRCTN",
"name": "correction"
},
{
"displayName": "Court Order",
"feeCode": "NOFEE",
"name": "courtOrder"
},
{
"displayName": "Voluntary Dissolution",
"feeCode": "DIS_VOL",
"name": "dissolution",
"type": "voluntary"
},
{
"displayName": "Administrative Dissolution",
"feeCode": "DIS_ADM",
"name": "dissolution",
"type": "administrative"
},
{
"displayName": "Registrar's Notation",
"feeCode": "NOFEE",
"name": "registrarsNotation"
},
{
"displayName": "Registrar's Order",
"feeCode": "NOFEE",
"name": "registrarsOrder"
},
{
"displayName": "Transition Application",
"feeCode": "TRANS",
"name": "transition"
}
]
}
},
"alternateNames": [],
"arMaxDate": "2024-06-28",
"arMinDate": "2024-06-27",
"associationType": null,
"complianceWarnings": [],
"fiscalYearEndDate": "2023-06-27",
"foundingDate": "2023-06-27T21:48:45.599278+00:00",
"goodStanding": true,
"hasCorrections": false,
"hasCourtOrders": false,
"hasRestrictions": false,
"identifier": "BC0871427",
"inDissolution": false,
"lastAddressChangeDate": "2023-06-27",
"lastAnnualGeneralMeetingDate": "",
"lastAnnualReportDate": "",
"lastDirectorChangeDate": "2024-05-22",
"lastLedgerTimestamp": "2023-06-27T21:48:47.354364+00:00",
"lastModified": "2024-05-22T16:22:39.006738+00:00",
"legalName": "0871427 B.C. LTD.",
"legalType": "BEN",
"naicsCode": null,
"naicsDescription": null,
"naicsKey": null,
"nextAnnualReport": "2024-06-27T07:00:00+00:00",
"noDissolution": false,
"state": "ACTIVE",
"submitter": "bcsc/jocxgslo54oopxozrht4uuneaxzhubek",
"warnings": []
}
}
2 changes: 1 addition & 1 deletion src/components/bcros/OfficeAddressBootstrap.vue
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@ defineProps<{ items: { title?: string }[] }>()
<UIcon name="i-mdi-email-outline" class="mr-5 text-2xl bg-primary" />
<div class="flex flex-col">
<div class="text-gray-900 pb-1">
{{ $t('label.address.addressType.delivery') }}
{{ $t('label.address.addressType.mailing') }}
</div>
<div class="flex justify-center">
<p>{{ $t('text.filing.completeYourFiling') }}</p>
Loading

0 comments on commit 3f3a0b0

Please sign in to comment.