Skip to content

Commit

Permalink
- app version = 5.9.6 (#661)
Browse files Browse the repository at this point in the history
- save region value instead of text (x2)
- fixed unit test

Co-authored-by: Severin Beauvais <[email protected]>
  • Loading branch information
severinbeauvais and Severin Beauvais authored Feb 20, 2024
1 parent 7284775 commit 4cb9bb9
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 14 deletions.
4 changes: 2 additions & 2 deletions 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 package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
11 changes: 5 additions & 6 deletions src/components/Amalgamation/AmalgamatingBusinesses.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
10 changes: 5 additions & 5 deletions tests/unit/AmalgamatingBusinesses.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Expand Down Expand Up @@ -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'
})
Expand All @@ -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')

Expand All @@ -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'
}
Expand All @@ -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'
})
Expand Down

0 comments on commit 4cb9bb9

Please sign in to comment.