Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

19897 Fixed foreign jurisdiction region #661

Merged
merged 1 commit into from
Feb 20, 2024

Conversation

severinbeauvais
Copy link
Collaborator

Issue #: bcgov/entity#19897

Description of changes:

  • app version = 5.9.6
  • save region value instead of text (x2)
  • fixed unit test

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the bcrs-entities-create-ui license (Apache 2.0).

- save region value instead of text (x2)
- fixed unit test
@severinbeauvais severinbeauvais self-assigned this Feb 20, 2024
@@ -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
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was actually causing some template errors. I originally had it this way so the default props would be used if we didn't specify them, but we always specify them anyway so '' is a better initial value.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(From a high level, default prop values are normally used when you DON'T specify the prop at all. If we do specify the prop, but want to use its default value, then we'll have to set it to undefined. Neither of these applies here.)

const tingBusiness = {
type: AmlTypes.FOREIGN,
role: AmlRoles.AMALGAMATING,
foreignJurisdiction: {
region: region.text,
region: JurisdictionLocation.BC,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before:
image

After:
image

@@ -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
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before:
image

After:
image

@@ -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' },
Copy link
Collaborator Author

@severinbeauvais severinbeauvais Feb 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is what the jurisdiction object actually looks like when it's selected.

@@ -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' })
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed this from BC to AB since BC isn't "foreign" :)

@severinbeauvais
Copy link
Collaborator Author

/gcbrun

@bcregistry-sre
Copy link
Collaborator

bcregistry-sre commented Feb 20, 2024

@severinbeauvais severinbeauvais merged commit 4cb9bb9 into bcgov:main Feb 20, 2024
5 checks passed
JazzarKarim pushed a commit to JazzarKarim/business-create-ui that referenced this pull request Feb 23, 2024
- save region value instead of text (x2)
- fixed unit test

Co-authored-by: Severin Beauvais <severin.beauvais@gov.bc.ca>
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants