From 80fd383da916750fc012ca2ad7675cfd5f110ea5 Mon Sep 17 00:00:00 2001 From: Maria Martinez Date: Tue, 2 Jan 2024 15:18:20 -0800 Subject: [PATCH] - Upgraded Cypress - Added Cypress test --- frontend/package-lock.json | 8 ++--- frontend/package.json | 2 +- .../components/forms/RadioInputComponent.vue | 1 + frontend/src/dto/ApplyClientNumberDto.ts | 1 - .../BusinessInformationWizardStep.vue | 5 ++- .../bceid/BusinessInformationWizardStep.cy.ts | 36 +++++++++++++++++++ 6 files changed, 46 insertions(+), 7 deletions(-) create mode 100644 frontend/tests/pages/bceid/BusinessInformationWizardStep.cy.ts diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 25680ffab3..5a92c2a1f8 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -38,7 +38,7 @@ "@vue/eslint-config-typescript": "^12.0.0", "@vue/test-utils": "^2.4.0", "@vue/tsconfig": "^0.4.0", - "cypress": "^13.6.1", + "cypress": "^13.6.2", "eslint": "^8.48.0", "eslint-config-prettier": "^9.0.0", "eslint-config-standard": "^17.1.0", @@ -6067,9 +6067,9 @@ "integrity": "sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==" }, "node_modules/cypress": { - "version": "13.6.1", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.6.1.tgz", - "integrity": "sha512-k1Wl5PQcA/4UoTffYKKaxA0FJKwg8yenYNYRzLt11CUR0Kln+h7Udne6mdU1cUIdXBDTVZWtmiUjzqGs7/pEpw==", + "version": "13.6.2", + "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.6.2.tgz", + "integrity": "sha512-TW3bGdPU4BrfvMQYv1z3oMqj71YI4AlgJgnrycicmPZAXtvywVFZW9DAToshO65D97rCWfG/kqMFsYB6Kp91gQ==", "dev": true, "hasInstallScript": true, "dependencies": { diff --git a/frontend/package.json b/frontend/package.json index 1643cee280..cb787d5c1c 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -71,7 +71,7 @@ "@vue/eslint-config-typescript": "^12.0.0", "@vue/test-utils": "^2.4.0", "@vue/tsconfig": "^0.4.0", - "cypress": "^13.6.1", + "cypress": "^13.6.2", "eslint": "^8.48.0", "eslint-config-prettier": "^9.0.0", "eslint-config-standard": "^17.1.0", diff --git a/frontend/src/components/forms/RadioInputComponent.vue b/frontend/src/components/forms/RadioInputComponent.vue index c3abb43aa4..1938642fef 100644 --- a/frontend/src/components/forms/RadioInputComponent.vue +++ b/frontend/src/components/forms/RadioInputComponent.vue @@ -96,6 +96,7 @@ revalidateBus.on(() => validateInput()); > If your name isn’t there, call BC Registry toll free at 1-877-526-1526 or email them at - . diff --git a/frontend/tests/pages/bceid/BusinessInformationWizardStep.cy.ts b/frontend/tests/pages/bceid/BusinessInformationWizardStep.cy.ts new file mode 100644 index 0000000000..ffa14b6240 --- /dev/null +++ b/frontend/tests/pages/bceid/BusinessInformationWizardStep.cy.ts @@ -0,0 +1,36 @@ +import BusinessInformationWizardStep from "@/pages/bceidform/BusinessInformationWizardStep.vue"; +import type { FormDataDto } from "@/dto/ApplyClientNumberDto"; + +describe('', () => { + beforeEach(() => { + cy.intercept('/api/clients/name/*').as('autoCompleteRequest'); + }); + + it('renders the BusinessInformationWizardStep component and interacts with elements', () => { + cy.mount(BusinessInformationWizardStep, { + props: { + data: { + businessInformation: { + businessType: "", + legalType: "", + clientType: "", + incorporationNumber: "", + businessName: "", + goodStandingInd: "", + birthdate: "", + address: "" + }, + } as unknown as FormDataDto, + active: false, + }, + }); + + cy.get('#businessTyperbR').click(); + + cy.get('#bcRegistryEmailId').click(); + + cy.get('.link-button:visible').should('have.attr', 'aria-label', 'Contact BC Registry via Email'); + cy.get('.link-button:visible span').should('exist'); + cy.get('.link-button:visible span').invoke('text').should('not.be.empty'); + }); +});