From 1c4736607e69e17a260d8f27f487eecf2c904e16 Mon Sep 17 00:00:00 2001 From: Severin Beauvais Date: Fri, 2 Feb 2024 16:32:29 -0800 Subject: [PATCH] - app version = 5.8.7 - deleted useless isViteRunning getter (was only used in 1 place) - changed re-routing code to not push the wrong route to history - update misc comments - fixed amalgamation statement validation (was undefined on draft restore) - updated certify statements (for regular and short-form amalgamations) - updated isAmalgamationInformationValid() - refactored Business Info test suite to handle regular vs horiz vs vert - misc cleanup --- package-lock.json | 4 +- package.json | 2 +- src/App.vue | 20 +- src/components/common/Actions.vue | 2 +- .../common/SummaryDefineCompany.vue | 1 - src/main.ts | 2 +- src/mixins/common-mixin.ts | 5 - src/mixins/filing-template-mixin.ts | 5 +- src/resources/AmalgamationRegular/BC.ts | 5 +- src/resources/AmalgamationRegular/BEN.ts | 5 +- src/resources/AmalgamationRegular/CC.ts | 5 +- src/resources/AmalgamationRegular/ULC.ts | 5 +- src/resources/AmalgamationShort/BC.ts | 5 +- src/resources/AmalgamationShort/BEN.ts | 5 +- src/resources/AmalgamationShort/CC.ts | 5 +- src/resources/AmalgamationShort/ULC.ts | 5 +- src/store/store.ts | 6 +- src/views/Amalgamation/BusinessInfo.vue | 8 +- src/views/Amalgamation/ReviewConfirm.vue | 4 +- tests/unit/AmalgamationBusinessInfo.spec.ts | 187 ++++++++++++------ tests/unit/AmalgamationInformation.spec.ts | 2 +- tests/unit/AmalgamationPeopleRoles.spec.ts | 38 +++- tests/unit/AmalgamationReviewConfirm.spec.ts | 6 +- tests/unit/AmalgamationShareStructure.spec.ts | 7 +- 24 files changed, 226 insertions(+), 113 deletions(-) diff --git a/package-lock.json b/package-lock.json index dd461f1a6..abc042f41 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "business-create-ui", - "version": "5.8.6", + "version": "5.8.7", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "business-create-ui", - "version": "5.8.6", + "version": "5.8.7", "dependencies": { "@babel/compat-data": "^7.21.5", "@bcrs-shared-components/approval-type": "1.0.19", diff --git a/package.json b/package.json index 4bdbb8094..d13f07580 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "business-create-ui", - "version": "5.8.6", + "version": "5.8.7", "private": true, "appName": "Create UI", "sbcName": "SBC Common Components", diff --git a/src/App.vue b/src/App.vue index f5c048783..5ba5eca26 100644 --- a/src/App.vue +++ b/src/App.vue @@ -667,8 +667,8 @@ export default class App extends Mixins(CommonMixin, DateMixin, FilingTemplateMi // reset errors in case this method is invoked more than once (ie, retry) this.resetFlags() - // don't check FF during Vitest tests - if (!this.isVitestRunning) { + // only check FF when not in Vitest tests + if (import.meta.env.VITEST === undefined) { // check that current route matches a supported filing type const supportedFilings = await GetFeatureFlag('supported-filings') if (!supportedFilings?.includes(this.$route.meta.filingType)) { @@ -753,31 +753,31 @@ export default class App extends Mixins(CommonMixin, DateMixin, FilingTemplateMi switch (this.getFilingType) { case FilingTypes.AMALGAMATION_APPLICATION: if (this.isAmalgamationFilingRegular) { - this.$router.push(RouteNames.AMALG_REG_INFORMATION).catch(() => {}) + this.$router.replace(RouteNames.AMALG_REG_INFORMATION).catch(() => {}) } else if (this.isAmalgamationFilingHorizontal || this.isAmalgamationFilingVertical) { - this.$router.push(RouteNames.AMALG_SHORT_INFORMATION).catch(() => {}) + this.$router.replace(RouteNames.AMALG_SHORT_INFORMATION).catch(() => {}) } else { throw new Error('invalid amalgamation filing type') } return case FilingTypes.CONTINUATION_IN: - this.$router.push(RouteNames.CONTINUATION_IN_BUSINESS_HOME).catch(() => {}) + this.$router.replace(RouteNames.CONTINUATION_IN_BUSINESS_HOME).catch(() => {}) return case FilingTypes.DISSOLUTION: if (this.isTypeFirm) { - this.$router.push(RouteNames.DISSOLUTION_FIRM).catch(() => {}) + this.$router.replace(RouteNames.DISSOLUTION_FIRM).catch(() => {}) } else { - this.$router.push(RouteNames.DISSOLUTION_DEFINE_DISSOLUTION).catch(() => {}) + this.$router.replace(RouteNames.DISSOLUTION_DEFINE_DISSOLUTION).catch(() => {}) } return case FilingTypes.INCORPORATION_APPLICATION: - this.$router.push(RouteNames.INCORPORATION_DEFINE_COMPANY).catch(() => {}) + this.$router.replace(RouteNames.INCORPORATION_DEFINE_COMPANY).catch(() => {}) return case FilingTypes.REGISTRATION: - this.$router.push(RouteNames.REGISTRATION_DEFINE_BUSINESS).catch(() => {}) + this.$router.replace(RouteNames.REGISTRATION_DEFINE_BUSINESS).catch(() => {}) return case FilingTypes.RESTORATION: - this.$router.push(RouteNames.RESTORATION_BUSINESS_NAME).catch(() => {}) + this.$router.replace(RouteNames.RESTORATION_BUSINESS_NAME).catch(() => {}) return default: this.invalidRouteDialog = true diff --git a/src/components/common/Actions.vue b/src/components/common/Actions.vue index 21de4b41d..ead2b5fca 100644 --- a/src/components/common/Actions.vue +++ b/src/components/common/Actions.vue @@ -303,7 +303,7 @@ export default class Actions extends Mixins(AmalgamationMixin, CommonMixin, this.setIsFilingPaying(false) } } else { - // don't call window.scrollTo during Vitest tests because jsdom doesn't implement it + // otherwise, smooth-scroll to the top of the page window.scrollTo({ top: 0, behavior: 'smooth' }) } } diff --git a/src/components/common/SummaryDefineCompany.vue b/src/components/common/SummaryDefineCompany.vue index 13d674df0..1f288ac9c 100644 --- a/src/components/common/SummaryDefineCompany.vue +++ b/src/components/common/SummaryDefineCompany.vue @@ -236,7 +236,6 @@ export default class SummaryDefineCompany extends Vue { /** Whether this section is invalid. */ get invalidSection (): boolean { if (this.isAmalgamationFiling) { - // *** FUTURE: update this for short-form amalgamation (needs to be valid) return (!this.isAmalgamationInformationValid || !this.isDefineCompanyValid) } return !this.isDefineCompanyValid diff --git a/src/main.ts b/src/main.ts index f4de2a357..a609cec73 100644 --- a/src/main.ts +++ b/src/main.ts @@ -78,7 +78,7 @@ async function start () { await KeycloakService.setKeycloakConfigUrl(keycloakConfig) // initialize token service which will do a check-sso to initiate session - // don't start during Vitest tests as it messes up the test JWT + // only do when not in Vitest tests as it messes up the test JWT if (import.meta.env.VITEST === undefined) { console.info('Starting token refresh service...') // eslint-disable-line no-console await KeycloakService.initializeToken() diff --git a/src/mixins/common-mixin.ts b/src/mixins/common-mixin.ts index ac4201c0d..894480603 100644 --- a/src/mixins/common-mixin.ts +++ b/src/mixins/common-mixin.ts @@ -9,11 +9,6 @@ import { getName } from 'country-list' */ @Component({}) export default class CommonMixin extends Vue { - /** Is True if Vitest is running the code. */ - get isVitestRunning (): boolean { - return (import.meta.env.VITEST !== undefined) - } - /** * Compares two objects while omitting specified properties from the comparison. * @param objA the first object to compare diff --git a/src/mixins/filing-template-mixin.ts b/src/mixins/filing-template-mixin.ts index 8bdd8497e..0502624f4 100644 --- a/src/mixins/filing-template-mixin.ts +++ b/src/mixins/filing-template-mixin.ts @@ -300,7 +300,10 @@ export default class FilingTemplateMixin extends Mixins(AmalgamationMixin, DateM } // restore the Amalgamation Court Approval if it's True or False - if (draftFiling.amalgamationApplication.courtApproval !== null) { + if ( + draftFiling.amalgamationApplication.courtApproval === true || + draftFiling.amalgamationApplication.courtApproval === false + ) { this.setAmalgamationCourtApproval(draftFiling.amalgamationApplication.courtApproval) } diff --git a/src/resources/AmalgamationRegular/BC.ts b/src/resources/AmalgamationRegular/BC.ts index 0ed561e03..ac835224a 100644 --- a/src/resources/AmalgamationRegular/BC.ts +++ b/src/resources/AmalgamationRegular/BC.ts @@ -31,7 +31,10 @@ export const AmalgamationRegResourceBc: AmalgamationResourceIF = { }, reviewAndConfirm: { completingPartyStatement: { - certifyStatements: [], + certifyStatements: [ + 'I have relevant knowledge of the business and that I am authorized to make this filing.', + 'I understand that this amalgamation cannot be reversed without a court order.' + ], certifyClause: `Note: It is an offence to make a false or misleading statement in respect of a material fact in a record submitted to the Corporate Registry for filing. See section 427 of the Business Corporations Act.`, diff --git a/src/resources/AmalgamationRegular/BEN.ts b/src/resources/AmalgamationRegular/BEN.ts index d491319e7..639eefe2d 100644 --- a/src/resources/AmalgamationRegular/BEN.ts +++ b/src/resources/AmalgamationRegular/BEN.ts @@ -31,7 +31,10 @@ export const AmalgamationRegResourceBen: AmalgamationResourceIF = { }, reviewAndConfirm: { completingPartyStatement: { - certifyStatements: [], + certifyStatements: [ + 'I have relevant knowledge of the business and that I am authorized to make this filing.', + 'I understand that this amalgamation cannot be reversed without a court order.' + ], certifyClause: `Note: It is an offence to make a false or misleading statement in respect of a material fact in a record submitted to the Corporate Registry for filing. See section 427 of the Business Corporations Act.`, diff --git a/src/resources/AmalgamationRegular/CC.ts b/src/resources/AmalgamationRegular/CC.ts index 090285e62..c07162f42 100644 --- a/src/resources/AmalgamationRegular/CC.ts +++ b/src/resources/AmalgamationRegular/CC.ts @@ -31,7 +31,10 @@ export const AmalgamationRegResourceCc: AmalgamationResourceIF = { }, reviewAndConfirm: { completingPartyStatement: { - certifyStatements: [], + certifyStatements: [ + 'I have relevant knowledge of the business and that I am authorized to make this filing.', + 'I understand that this amalgamation cannot be reversed without a court order.' + ], certifyClause: `Note: It is an offence to make a false or misleading statement in respect of a material fact in a record submitted to the Corporate Registry for filing. See section 427 of the Business Corporations Act.`, diff --git a/src/resources/AmalgamationRegular/ULC.ts b/src/resources/AmalgamationRegular/ULC.ts index ddd6c739a..9aadab1f5 100644 --- a/src/resources/AmalgamationRegular/ULC.ts +++ b/src/resources/AmalgamationRegular/ULC.ts @@ -31,7 +31,10 @@ export const AmalgamationRegResourceUlc: AmalgamationResourceIF = { }, reviewAndConfirm: { completingPartyStatement: { - certifyStatements: [], + certifyStatements: [ + 'I have relevant knowledge of the business and that I am authorized to make this filing.', + 'I understand that this amalgamation cannot be reversed without a court order.' + ], certifyClause: `Note: It is an offence to make a false or misleading statement in respect of a material fact in a record submitted to the Corporate Registry for filing. See section 427 of the Business Corporations Act.`, diff --git a/src/resources/AmalgamationShort/BC.ts b/src/resources/AmalgamationShort/BC.ts index 455e30519..3d97e59fa 100644 --- a/src/resources/AmalgamationShort/BC.ts +++ b/src/resources/AmalgamationShort/BC.ts @@ -33,7 +33,10 @@ export const AmalgamationShortResourceBc: AmalgamationResourceIF = { }, reviewAndConfirm: { completingPartyStatement: { - certifyStatements: [], + certifyStatements: [ + 'I have relevant knowledge of the business and that I am authorized to make this filing.', + 'I understand that this amalgamation cannot be reversed without a court order.' + ], certifyClause: `Note: It is an offence to make a false or misleading statement in respect of a material fact in a record submitted to the Corporate Registry for filing. See section 427 of the Business Corporations Act.`, diff --git a/src/resources/AmalgamationShort/BEN.ts b/src/resources/AmalgamationShort/BEN.ts index 8aaf857ea..c1ae2e3c6 100644 --- a/src/resources/AmalgamationShort/BEN.ts +++ b/src/resources/AmalgamationShort/BEN.ts @@ -33,7 +33,10 @@ export const AmalgamationShortResourceBen: AmalgamationResourceIF = { }, reviewAndConfirm: { completingPartyStatement: { - certifyStatements: [], + certifyStatements: [ + 'I have relevant knowledge of the business and that I am authorized to make this filing.', + 'I understand that this amalgamation cannot be reversed without a court order.' + ], certifyClause: `Note: It is an offence to make a false or misleading statement in respect of a material fact in a record submitted to the Corporate Registry for filing. See section 427 of the Business Corporations Act.`, diff --git a/src/resources/AmalgamationShort/CC.ts b/src/resources/AmalgamationShort/CC.ts index 2155b58ec..55d1fff52 100644 --- a/src/resources/AmalgamationShort/CC.ts +++ b/src/resources/AmalgamationShort/CC.ts @@ -33,7 +33,10 @@ export const AmalgamationShortResourceCc: AmalgamationResourceIF = { }, reviewAndConfirm: { completingPartyStatement: { - certifyStatements: [], + certifyStatements: [ + 'I have relevant knowledge of the business and that I am authorized to make this filing.', + 'I understand that this amalgamation cannot be reversed without a court order.' + ], certifyClause: `Note: It is an offence to make a false or misleading statement in respect of a material fact in a record submitted to the Corporate Registry for filing. See section 427 of the Business Corporations Act.`, diff --git a/src/resources/AmalgamationShort/ULC.ts b/src/resources/AmalgamationShort/ULC.ts index 6b6207b80..0c6e0071e 100644 --- a/src/resources/AmalgamationShort/ULC.ts +++ b/src/resources/AmalgamationShort/ULC.ts @@ -33,7 +33,10 @@ export const AmalgamationShortResourceUlc: AmalgamationResourceIF = { }, reviewAndConfirm: { completingPartyStatement: { - certifyStatements: [], + certifyStatements: [ + 'I have relevant knowledge of the business and that I am authorized to make this filing.', + 'I understand that this amalgamation cannot be reversed without a court order.' + ], certifyClause: `Note: It is an offence to make a false or misleading statement in respect of a material fact in a record submitted to the Corporate Registry for filing. See section 427 of the Business Corporations Act.`, diff --git a/src/store/store.ts b/src/store/store.ts index 1880ed793..6c54f3ded 100644 --- a/src/store/store.ts +++ b/src/store/store.ts @@ -601,10 +601,10 @@ export const useStore = defineStore('store', { ) } else { return ( - // *** FUTURE: update this when Resulting Company Name is implemented this.getAmalgamatingBusinessesValid && - !!this.getCorrectNameOption && - this.getNameTranslationsValid + // NB - this is the only valid Correct Name Option for short-form amalgamations: + this.getCorrectNameOption === CorrectNameOptions.CORRECT_AML_ADOPT + // NB - there are no name translations for short-form amalgamations ) } }, diff --git a/src/views/Amalgamation/BusinessInfo.vue b/src/views/Amalgamation/BusinessInfo.vue index 9b951998c..a039179bf 100644 --- a/src/views/Amalgamation/BusinessInfo.vue +++ b/src/views/Amalgamation/BusinessInfo.vue @@ -1,6 +1,6 @@