-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Side accordions for addresses, directors, partners and proprietors (#6)
* set up basic dashboard template and UI for address accordion * update AddressAccordion * update i18n text * set up current directors accordion * Side accordions for directors, partners, and proprietors * fix AddressDisplay unit test * cypress tests --------- Co-authored-by: Patrick Wang <root@NI502169.idir.BCGOV>
- Loading branch information
1 parent
96a5422
commit 7475402
Showing
33 changed files
with
1,117 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
context('Business dashboard -> Address side component', () => { | ||
beforeEach(() => { | ||
cy.visitBusinessDash() | ||
}) | ||
|
||
it('Address accordion is rendered for Registered Office and Record Office', () => { | ||
cy.getOfficeAddresses() | ||
|
||
// the accordion exists | ||
cy.get('[data-cy="accordion_officeAddresses"]').should('exist') | ||
|
||
// accordion headers exist | ||
cy.get('[data-cy="accordion_item_button_officeAddresses0"]').contains('Registered Office').should('be.visible') | ||
cy.get('[data-cy="accordion_item_button_officeAddresses1"]').contains('Records Office').should('be.visible') | ||
|
||
// the first accordion item is expanded by default and it contain address information | ||
cy.get('[data-cy="officeAddresses_0"]').contains('Delivery Address').should('be.visible') | ||
cy.get('[data-cy="officeAddresses_0"]').contains('Mailing Address').should('be.visible') | ||
cy.get('[data-cy="officeAddresses_1"]').contains('Delivery Address').should('not.be.visible') | ||
cy.get('[data-cy="officeAddresses_1"]').contains('Mailing Address').should('not.be.visible') | ||
|
||
// expand the second item | ||
cy.get('[data-cy="accordion_item_button_officeAddresses1"]').click() | ||
|
||
// Note: the current config allow only one item to be expanded | ||
// This is different from the behavior of the old dashboard. | ||
cy.get('[data-cy="officeAddresses_0"]').contains('Delivery Address').should('not.be.visible') | ||
cy.get('[data-cy="officeAddresses_0"]').contains('Mailing Address').should('not.be.visible') | ||
cy.get('[data-cy="officeAddresses_1"]').contains('Delivery Address').should('be.visible') | ||
cy.get('[data-cy="officeAddresses_1"]').contains('Mailing Address').should('be.visible') | ||
}) | ||
|
||
it('Business Addresses section is rendered for SP and GP', () => { | ||
cy.getBusinessAddresses() | ||
cy.get('[data-cy="accordion_officeAddresses"]').should('not.exist') | ||
cy.get('[data-cy="businessAddresses"]').should('exist') | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
context('Business dashboard -> Parties side components', () => { | ||
beforeEach(() => { | ||
cy.visitBusinessDash() | ||
}) | ||
|
||
it('Directors accordion is rendered', () => { | ||
cy.getDirectorParties() | ||
cy.get('[data-cy="accordion_directors"]').should('exist') | ||
cy.get('[data-cy="accordion_directors"]').children().eq(0).children().should('have.length', 5) | ||
}) | ||
|
||
it('Partners accordion is rendered', () => { | ||
cy.getPartnerParties() | ||
cy.get('[data-cy="accordion_partners"]').should('exist') | ||
cy.get('[data-cy="accordion_partners"]').children().eq(0).children().should('have.length', 3) | ||
}) | ||
|
||
it('Proprietors accordion is rendered', () => { | ||
cy.getProprietorParties() | ||
cy.get('[data-cy="accordion_proprietors"]').should('exist') | ||
cy.get('[data-cy="accordion_proprietors"]').children().eq(0).children().should('have.length', 1) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{ | ||
"recordsOffice": { | ||
"deliveryAddress": { | ||
"addressCity": "Vancouver", | ||
"addressCountry": "CA", | ||
"addressRegion": "BC", | ||
"addressType": "delivery", | ||
"deliveryInstructions": "", | ||
"id": 2716699, | ||
"postalCode": "V6J 5L2", | ||
"streetAddress": "201-1768 8th Ave W", | ||
"streetAddressAdditional": "" | ||
}, | ||
"mailingAddress": { | ||
"addressCity": "Vancouver", | ||
"addressCountry": "CA", | ||
"addressRegion": "BC", | ||
"addressType": "mailing", | ||
"deliveryInstructions": "", | ||
"id": 2716698, | ||
"postalCode": "V6J 5L2", | ||
"streetAddress": "201-1768 8th Ave W", | ||
"streetAddressAdditional": "" | ||
} | ||
}, | ||
"registeredOffice": { | ||
"deliveryAddress": { | ||
"addressCity": "Vancouver", | ||
"addressCountry": "CA", | ||
"addressRegion": "BC", | ||
"addressType": "delivery", | ||
"deliveryInstructions": "", | ||
"id": 2716701, | ||
"postalCode": "V6J 5L2", | ||
"streetAddress": "201-1768 8th Ave W", | ||
"streetAddressAdditional": "" | ||
}, | ||
"mailingAddress": { | ||
"addressCity": "Vancouver", | ||
"addressCountry": "CA", | ||
"addressRegion": "BC", | ||
"addressType": "mailing", | ||
"deliveryInstructions": "", | ||
"id": 2716700, | ||
"postalCode": "V6J 5L2", | ||
"streetAddress": "201-1768 8th Ave W", | ||
"streetAddressAdditional": "" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"businessOffice": { | ||
"deliveryAddress": { | ||
"addressCity": "Prince Rupert", | ||
"addressCountry": "CA", | ||
"addressRegion": "BC", | ||
"addressType": "delivery", | ||
"deliveryInstructions": null, | ||
"id": 2776826, | ||
"postalCode": "V8J 4C5", | ||
"streetAddress": "153 Alpine Dr", | ||
"streetAddressAdditional": "" | ||
}, | ||
"mailingAddress": { | ||
"addressCity": "Prince Rupert", | ||
"addressCountry": "CA", | ||
"addressRegion": "BC", | ||
"addressType": "mailing", | ||
"deliveryInstructions": null, | ||
"id": 2776825, | ||
"postalCode": "V8J 4C5", | ||
"streetAddress": "153 Alpine Dr", | ||
"streetAddressAdditional": "" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,184 @@ | ||
{ | ||
"parties": [ | ||
{ | ||
"deliveryAddress": { | ||
"addressCity": "Oakville", | ||
"addressCountry": "CA", | ||
"addressRegion": "ON", | ||
"deliveryInstructions": "", | ||
"id": 2841040, | ||
"postalCode": "L6M 4M6", | ||
"streetAddress": "23-1489 Heritage Way", | ||
"streetAddressAdditional": "" | ||
}, | ||
"mailingAddress": { | ||
"addressCity": "Oakville", | ||
"addressCountry": "CA", | ||
"addressRegion": "ON", | ||
"deliveryInstructions": "", | ||
"id": 2841041, | ||
"postalCode": "L6M 4M6", | ||
"streetAddress": "23-1489 Heritage Way", | ||
"streetAddressAdditional": "" | ||
}, | ||
"officer": { | ||
"email": null, | ||
"firstName": "SD", | ||
"id": 578627, | ||
"lastName": "S", | ||
"partyType": "person" | ||
}, | ||
"roles": [ | ||
{ | ||
"appointmentDate": "2024-04-02", | ||
"cessationDate": null, | ||
"roleType": "Director" | ||
} | ||
] | ||
}, | ||
{ | ||
"deliveryAddress": { | ||
"addressCity": "Oakville", | ||
"addressCountry": "CA", | ||
"addressRegion": "ON", | ||
"deliveryInstructions": null, | ||
"id": 2841026, | ||
"postalCode": "L6M 4M6", | ||
"streetAddress": "34-1489 Heritage Way", | ||
"streetAddressAdditional": "" | ||
}, | ||
"mailingAddress": { | ||
"addressCity": "Oakville", | ||
"addressCountry": "CA", | ||
"addressRegion": "ON", | ||
"deliveryInstructions": null, | ||
"id": 2841027, | ||
"postalCode": "L6M 4M6", | ||
"streetAddress": "34-1489 Heritage Way", | ||
"streetAddressAdditional": "" | ||
}, | ||
"officer": { | ||
"email": null, | ||
"firstName": "SDF", | ||
"id": 581750, | ||
"lastName": "ASDF", | ||
"partyType": "person" | ||
}, | ||
"roles": [ | ||
{ | ||
"appointmentDate": "2024-04-02", | ||
"cessationDate": null, | ||
"roleType": "Director" | ||
} | ||
] | ||
}, | ||
{ | ||
"deliveryAddress": { | ||
"addressCity": "Oakville", | ||
"addressCountry": "CA", | ||
"addressRegion": "ON", | ||
"deliveryInstructions": "", | ||
"id": 2841036, | ||
"postalCode": "L6M 4M6", | ||
"streetAddress": "34-1489 Heritage Way", | ||
"streetAddressAdditional": "" | ||
}, | ||
"mailingAddress": { | ||
"addressCity": "Oakville", | ||
"addressCountry": "CA", | ||
"addressRegion": "ON", | ||
"deliveryInstructions": "", | ||
"id": 2841037, | ||
"postalCode": "L6M 4M6", | ||
"streetAddress": "34-1489 Heritage Way", | ||
"streetAddressAdditional": "" | ||
}, | ||
"officer": { | ||
"email": null, | ||
"firstName": "KIAL", | ||
"id": 581751, | ||
"lastName": "TEST", | ||
"partyType": "person" | ||
}, | ||
"roles": [ | ||
{ | ||
"appointmentDate": "2024-04-02", | ||
"cessationDate": null, | ||
"roleType": "Director" | ||
} | ||
] | ||
}, | ||
{ | ||
"deliveryAddress": { | ||
"addressCity": "Edmonton", | ||
"addressCountry": "CA", | ||
"addressRegion": "AB", | ||
"deliveryInstructions": null, | ||
"id": 2841030, | ||
"postalCode": "T6L 7G9", | ||
"streetAddress": "324-5211 25 Ave NW", | ||
"streetAddressAdditional": "" | ||
}, | ||
"mailingAddress": { | ||
"addressCity": "Edmonton", | ||
"addressCountry": "CA", | ||
"addressRegion": "AB", | ||
"deliveryInstructions": null, | ||
"id": 2841031, | ||
"postalCode": "T6L 7G9", | ||
"streetAddress": "324-5211 25 Ave NW", | ||
"streetAddressAdditional": "" | ||
}, | ||
"officer": { | ||
"email": null, | ||
"firstName": "SD", | ||
"id": 581752, | ||
"lastName": "S", | ||
"partyType": "person" | ||
}, | ||
"roles": [ | ||
{ | ||
"appointmentDate": "2024-04-02", | ||
"cessationDate": null, | ||
"roleType": "Director" | ||
} | ||
] | ||
}, | ||
{ | ||
"deliveryAddress": { | ||
"addressCity": "Pitt Meadows", | ||
"addressCountry": "CA", | ||
"addressRegion": "BC", | ||
"deliveryInstructions": null, | ||
"id": 2841034, | ||
"postalCode": "V3Y 1T2", | ||
"streetAddress": "34-19032 Advent Rd", | ||
"streetAddressAdditional": "" | ||
}, | ||
"mailingAddress": { | ||
"addressCity": "Pitt Meadows", | ||
"addressCountry": "CA", | ||
"addressRegion": "BC", | ||
"deliveryInstructions": null, | ||
"id": 2841035, | ||
"postalCode": "V3Y 1T2", | ||
"streetAddress": "34-19032 Advent Rd", | ||
"streetAddressAdditional": "" | ||
}, | ||
"officer": { | ||
"email": null, | ||
"firstName": "DF", | ||
"id": 581753, | ||
"lastName": "ADF", | ||
"partyType": "person" | ||
}, | ||
"roles": [ | ||
{ | ||
"appointmentDate": "2024-04-02", | ||
"cessationDate": null, | ||
"roleType": "Director" | ||
} | ||
] | ||
} | ||
] | ||
} |
Oops, something went wrong.