Skip to content

Commit fc2fd5d

Browse files
feat(fe:FSADT1-1959): Location – Name default is ‘Mailing address (#1717)
feat(fe:FSADT1-1959): Location – Name default is ‘Mailing address
1 parent 7e813ae commit fc2fd5d

11 files changed

Lines changed: 20 additions & 29 deletions

File tree

cypress/cypress/e2e/staffCreate.feature

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ Feature: Staff Screens
1919
Then I click on next
2020
And I fill the "Primary location" address with the following
2121
| Field name | Value | Type |
22-
| Location name | Office | text |
2322
| Email address | jamesbaxter@mail.ca | text |
2423
| Primary phone number | 2501231568 | text |
2524
| Secondary phone number | 2501233568 | text |
@@ -33,7 +32,7 @@ Feature: Staff Screens
3332
| Secondary phone number | 2501232567 | text |
3433
| Fax | 2501444567 | text |
3534
| Contact type | Billing | select |
36-
| Associated locations | Office | multiselect |
35+
| Associated locations | Mailing address | multiselect |
3736
Then I click on next
3837
Then I submit
3938
And I wait for the text "has been created!" to appear
@@ -92,4 +91,4 @@ Feature: Staff Screens
9291
| ID number | 1234567 | text |
9392
Then I click on next
9493
And I should see the "warning" message "was found with similar name and birthdate" on the "top"
95-
And The field "First name" should have the "warning" message "There's already a client with this name"
94+
And The field "First name" should have the "warning" message "There's already a client with this name"

cypress/cypress/e2e/upt_1257.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Feature: Client Type Code
2424
And I fill the "Primary contact" information with the following
2525
| Field name | Value | Type |
2626
| First name | Testy | text |
27-
| Last name | Tester | text |
27+
| Last name | Tester | text |
2828
| Email address | mail5@mail.ca | text |
2929
| Primary phone number | 7780000007 | text |
3030
| Contact type | Billing | select |

frontend/cypress/e2e/pages/FormStaffPage.cy.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ describe("Staff Form", () => {
2020
};
2121

2222
const locationBaseData = {
23-
name_0: "Headquarters",
23+
name_0: "Mailing address",
2424
addr_0: "2975",
2525
};
2626

@@ -46,10 +46,6 @@ describe("Staff Form", () => {
4646

4747
cy.fillFormEntry("#clientIdentification", data.clientIdentification);
4848

49-
/*cy.get("#birthdateYear").shadow().find("input").type(data.birthdateYear);
50-
cy.get("#birthdateMonth").shadow().find("input").type(data.birthdateMonth);
51-
cy.get("#birthdateDay").shadow().find("input").type(data.birthdateDay);*/
52-
5349
//This way of filling out data fails locally only with this component
5450
cy.fillFormEntry("#birthdateYear", data.birthdateYear);
5551
cy.fillFormEntry("#birthdateMonth", data.birthdateMonth);
@@ -71,8 +67,6 @@ describe("Staff Form", () => {
7167
};
7268

7369
const fillLocation = (data = locationBaseData) => {
74-
cy.get("#name_0").shadow().find("input").type(data.name_0);
75-
7670
cy.get("#addr_0").shadow().find("input").type(data.addr_0, { delay: 0 });
7771

7872
cy.wait("@searchAddress");

frontend/cypress/e2e/pages/FormStaffPageSubmission.cy.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ describe("Staff Form Submission", () => {
3838
const fillLocation = (index: number, extraData: any = {}) => {
3939
cy.fixture("testdata/locationBaseData").then((fixtureData: any) => {
4040
const data = { ...fixtureData, ...extraData };
41-
42-
cy.fillFormEntry(`#name_${index}`, data.name);
41+
4342
cy.selectAutocompleteEntry(`#addr_${index}`, data.addr, data.addressId);
4443
cy.fillFormEntry(`#emailAddress_${index}`, data.emailAddress);
4544
cy.fillFormEntry(`#businessPhoneNumber_${index}`, data.businessPhoneNumber);

frontend/cypress/fixtures/testdata/contactBaseData.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
"faxNumber": "1234567890",
88
"role": "Person",
99
"addressname": "Mailing address"
10-
}
10+
}

frontend/src/dto/ApplyClientNumberDto.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ export const indexedEmptyAddress = (index: number): Address =>
9898
}),
9999
);
100100

101+
export const defaultLocation = { value: "0", text: "Mailing address" };
102+
101103
export const emptyAddress = (): Address => indexedEmptyAddress(0);
102104

103105
export const formatAddresses = (addresses: Address[]): Address[] => {
@@ -107,7 +109,7 @@ export const formatAddresses = (addresses: Address[]): Address[] => {
107109
locationName: toSentenceCase(address.locationName),
108110
}));
109111
}
110-
return [{ ...emptyAddress(), locationName: locationName.text }];
112+
return [{ ...emptyAddress(), locationName: defaultLocation.text }];
111113
};
112114

113115
export const indexedEmptyContact = (index: number): Contact =>
@@ -127,8 +129,6 @@ export const indexedEmptyContact = (index: number): Contact =>
127129

128130
export const emptyContact: Contact = indexedEmptyContact(0);
129131

130-
export const locationName = { value: "0", text: "Mailing address" };
131-
132132
export const formDataDto: FormDataDto = {
133133
businessInformation: {
134134
district: "",
@@ -158,10 +158,8 @@ export const formDataDto: FormDataDto = {
158158
notifyClientInd: ""
159159
};
160160

161-
export const newFormDataDto = (): FormDataDto => JSON.parse(JSON.stringify(formDataDto));
162-
163-
export const newFormDataDtoExternal = (): FormDataDto => {
164-
const value = newFormDataDto();
165-
value.location.addresses[0].locationName = locationName.text;
161+
export const newFormDataDto = (): FormDataDto => {
162+
const value = JSON.parse(JSON.stringify(formDataDto));
163+
value.location.addresses[0].locationName = defaultLocation.text;
166164
return value;
167165
};

frontend/src/pages/FormBCSCPage.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
<script setup lang="ts">
33
import { ref, reactive, computed, watch, toRef } from "vue";
44
import {
5-
newFormDataDtoExternal,
5+
newFormDataDto,
66
emptyContact,
7-
locationName as defaultLocation,
7+
defaultLocation,
88
} from "@/dto/ApplyClientNumberDto";
99
import {
1010
BusinessTypeEnum,
@@ -53,7 +53,7 @@ const submitterContact: Contact = {
5353
email: submitterInformation?.email ?? "",
5454
};
5555
56-
let formDataDto = ref<FormDataDto>({ ...newFormDataDtoExternal() });
56+
let formDataDto = ref<FormDataDto>({ ...newFormDataDto() });
5757
5858
const figmaFormatter = new Intl.DateTimeFormat("en-US", {
5959
year: "numeric",

frontend/src/pages/FormBCeIDPage.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import AddressWizardStep from "@/pages/bceidform/AddressWizardStep.vue";
1818
import ContactWizardStep from "@/pages/bceidform/ContactWizardStep.vue";
1919
import ReviewWizardStep from "@/pages/bceidform/ReviewWizardStep.vue";
2020
// Imported types
21-
import { newFormDataDtoExternal, locationName as defaultLocation } from "@/dto/ApplyClientNumberDto";
21+
import { newFormDataDto, defaultLocation } from "@/dto/ApplyClientNumberDto";
2222
import type { FormDataDto, Contact } from "@/dto/ApplyClientNumberDto";
2323
import type {
2424
ValidationMessageType,
@@ -76,7 +76,7 @@ if (!features.BCEID_MULTI_ADDRESS) {
7676
submitterContact.locationNames = [{ ...defaultLocation }];
7777
}
7878
79-
let formDataDto = ref<FormDataDto>({ ...newFormDataDtoExternal() });
79+
let formDataDto = ref<FormDataDto>({ ...newFormDataDto() });
8080
8181
//---- Form Data ----//
8282
let formData = reactive<FormDataDto>({

frontend/src/pages/bceidform/BusinessInformationWizardStep.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515
ProgressNotification,
1616
} from "@/dto/CommonTypesDto";
1717
import { BusinessTypeEnum, CodeNameType } from "@/dto/CommonTypesDto";
18-
import { locationName as defaultLocation, formatAddresses } from "@/dto/ApplyClientNumberDto";
18+
import { defaultLocation, formatAddresses } from "@/dto/ApplyClientNumberDto";
1919
import type {
2020
FormDataDto,
2121
ForestClientDetailsDto,

frontend/src/pages/bceidform/ContactWizardStep.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { useFetchTo } from "@/composables/useFetch";
88
import { useFocus } from "@/composables/useFocus";
99
// Type Imports
1010
import type { FormDataDto, Contact } from "@/dto/ApplyClientNumberDto";
11-
import { emptyContact, locationName as defaultLocation } from "@/dto/ApplyClientNumberDto";
11+
import { emptyContact, defaultLocation } from "@/dto/ApplyClientNumberDto";
1212
import type { CodeNameType, ModalNotification } from "@/dto/CommonTypesDto";
1313
// Validators
1414
import { isUniqueDescriptive } from "@/helpers/validators/GlobalValidators";

0 commit comments

Comments
 (0)