Skip to content

Commit

Permalink
- Upgraded Cypress
Browse files Browse the repository at this point in the history
- Added Cypress test
  • Loading branch information
mamartinezmejia committed Jan 2, 2024
1 parent 879cb63 commit 80fd383
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 7 deletions.
8 changes: 4 additions & 4 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions frontend/src/components/forms/RadioInputComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ revalidateBus.on(() => validateInput());
>
<cds-radio-button
v-shadow="1"
:id="id + 'rb' + option.value"
v-for="option in modelValue"
:key="id + 'rb' + option.value"
:label-text="option.text"
Expand Down
1 change: 0 additions & 1 deletion frontend/src/dto/ApplyClientNumberDto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ export interface FormDataDto {
goodStandingInd: string;
birthdate: string;
address: Address;

};
location: {
addresses: Address[];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,10 @@ const bcRegistryEmail = "[email protected]";
<li class="body-compact-01">
If your name isn’t there, call BC Registry toll free at
<a href="tel:18775261526">1-877-526-1526</a> or email them at
<button class="link-button" @click="openMailtoLink(bcRegistryEmail)" aria-label="Contact BC Registry via Email">
<button id="bcRegistryEmailId"
class="link-button"
@click="openMailtoLink(bcRegistryEmail)"
aria-label="Contact BC Registry via Email">
<span v-bind:innerHTML="getObfuscatedEmail(bcRegistryEmail)"></span>
</button>.
</li>
Expand Down
36 changes: 36 additions & 0 deletions frontend/tests/pages/bceid/BusinessInformationWizardStep.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import BusinessInformationWizardStep from "@/pages/bceidform/BusinessInformationWizardStep.vue";
import type { FormDataDto } from "@/dto/ApplyClientNumberDto";

describe('<BusinessInformationWizardStep />', () => {
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');
});
});

0 comments on commit 80fd383

Please sign in to comment.