From 0374e2c4c9418f2b681d8f1dadb7fbd287668bbb Mon Sep 17 00:00:00 2001 From: Severin Beauvais Date: Tue, 20 Feb 2024 11:35:42 -0800 Subject: [PATCH] - app version = 5.9.6 - save region value instead of text (x2) - fixed unit test --- package-lock.json | 4 ++-- package.json | 2 +- .../Amalgamation/AmalgamatingBusinesses.vue | 11 +++++------ tests/unit/AmalgamatingBusinesses.spec.ts | 10 +++++----- 4 files changed, 13 insertions(+), 14 deletions(-) diff --git a/package-lock.json b/package-lock.json index da73e53bf..6a07c040d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "business-create-ui", - "version": "5.9.5", + "version": "5.9.6", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "business-create-ui", - "version": "5.9.5", + "version": "5.9.6", "dependencies": { "@babel/compat-data": "^7.21.5", "@bcrs-shared-components/approval-type": "1.0.19", diff --git a/package.json b/package.json index e61080df9..80298f874 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "business-create-ui", - "version": "5.9.5", + "version": "5.9.6", "private": true, "appName": "Create UI", "sbcName": "SBC Common Components", diff --git a/src/components/Amalgamation/AmalgamatingBusinesses.vue b/src/components/Amalgamation/AmalgamatingBusinesses.vue index 6b41657c5..1dc433992 100644 --- a/src/components/Amalgamation/AmalgamatingBusinesses.vue +++ b/src/components/Amalgamation/AmalgamatingBusinesses.vue @@ -277,7 +277,7 @@ import { AmalgamationMixin, CommonMixin } from '@/mixins' import { BusinessLookupServices } from '@/services' import { BusinessLookup } from '@bcrs-shared-components/business-lookup' import { Jurisdiction } from '@bcrs-shared-components/jurisdiction' -import { CanJurisdictions, MrasJurisdictions } from '@bcrs-shared-components/jurisdiction/list-data' +import { MrasJurisdictions } from '@bcrs-shared-components/jurisdiction/list-data' import { AmalgamatingBusinessIF, BusinessLookupResultIF, EmptyBusinessLookup } from '@/interfaces' import { AmlRoles, AmlTypes, EntityStates } from '@/enums' import { JurisdictionLocation } from '@bcrs-shared-components/enums' @@ -316,8 +316,8 @@ export default class AmalgamatingBusinesses extends Mixins(AmalgamationMixin, Co snackbar = false snackbarText = '' errorDialog = false - errorDialogText = undefined as string - errorDialogTitle = undefined as string + errorDialogText = '' + errorDialogTitle = '' // Foreign business properties jurisdiction = null @@ -418,12 +418,11 @@ export default class AmalgamatingBusinesses extends Mixins(AmalgamationMixin, Co // Special case to handle Extra Pro A companies if ((businessLookup.legalType as any) === CorpTypeCd.EXTRA_PRO_A) { - const region = CanJurisdictions.find(jurisdiction => jurisdiction.value === JurisdictionLocation.BC) const tingBusiness = { type: AmlTypes.FOREIGN, role: AmlRoles.AMALGAMATING, foreignJurisdiction: { - region: region.text, + region: JurisdictionLocation.BC, country: JurisdictionLocation.CA }, legalName: businessLookup.name, @@ -549,7 +548,7 @@ export default class AmalgamatingBusinesses extends Mixins(AmalgamationMixin, Co type: AmlTypes.FOREIGN, role: AmlRoles.AMALGAMATING, foreignJurisdiction: { - region: this.isCan ? this.jurisdiction.text : '', + region: this.isCan ? this.jurisdiction.value : '', // no region outside Canada country: this.isCan ? JurisdictionLocation.CA : this.jurisdiction.value }, legalName: this.legalName, diff --git a/tests/unit/AmalgamatingBusinesses.spec.ts b/tests/unit/AmalgamatingBusinesses.spec.ts index 4844dd869..2e8f956cc 100644 --- a/tests/unit/AmalgamatingBusinesses.spec.ts +++ b/tests/unit/AmalgamatingBusinesses.spec.ts @@ -255,7 +255,7 @@ describe('Amalgamating Businesses - add amalgamating business', () => { const business = store.getAmalgamatingBusinesses[0] as any expect(business.type).toBe(AmlTypes.FOREIGN) expect(business.role).toBe(AmlRoles.AMALGAMATING) - expect(business.foreignJurisdiction).toEqual({ country: 'CA', region: 'British Columbia' }) + expect(business.foreignJurisdiction).toEqual({ country: 'CA', region: 'BC' }) expect(business.legalName).toBe('Extra Pro Business') expect(business.identifier).toBe('A1234567') @@ -638,7 +638,7 @@ describe('Amalgamating Businesses - add amalgamating foreign business', () => { // simulate form data await wrapper.setData({ isCan: true, - jurisdiction: { text: 'BC', value: 'CA' }, + jurisdiction: { text: 'Alberta', value: 'AB' }, legalName: 'Foreign Business', identifier: 'ABC-123' }) @@ -654,7 +654,7 @@ describe('Amalgamating Businesses - add amalgamating foreign business', () => { const business = store.getAmalgamatingBusinesses[0] as any expect(business.type).toBe(AmlTypes.FOREIGN) expect(business.role).toBe(AmlRoles.AMALGAMATING) - expect(business.foreignJurisdiction).toEqual({ country: 'CA', region: 'BC' }) + expect(business.foreignJurisdiction).toEqual({ country: 'CA', region: 'AB' }) expect(business.legalName).toBe('Foreign Business') expect(business.identifier).toBe('ABC-123') @@ -668,7 +668,7 @@ describe('Amalgamating Businesses - add amalgamating foreign business', () => { { type: AmlTypes.FOREIGN, role: AmlRoles.AMALGAMATING, - foreignJurisdiction: { country: 'CA', region: 'British Columbia' }, + foreignJurisdiction: { country: 'CA', region: 'AB' }, legalName: 'Foreign Business', identifier: 'ABC-123' } @@ -681,7 +681,7 @@ describe('Amalgamating Businesses - add amalgamating foreign business', () => { // simulate form data await wrapper.setData({ isCan: true, - jurisdiction: { text: 'British Columbia', value: 'CA' }, + jurisdiction: { text: 'Alberta', value: 'AB' }, legalName: 'Foreign Business', identifier: 'ABC-123' })