Skip to content

Commit

Permalink
Added amalgamation FF check (bcgov#610)
Browse files Browse the repository at this point in the history
* Added amalgamation FF check

* Fixed unit tests

* typo
  • Loading branch information
JazzarKarim committed Jan 27, 2024
1 parent e069567 commit 8caf1da
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 4 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-filings-ui",
"version": "7.0.34",
"version": "7.0.35",
"private": true,
"appName": "Filings UI",
"sbcName": "SBC Common Components",
Expand Down
5 changes: 5 additions & 0 deletions src/components/EntityInfo/EntityMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@
>
<template #activator="{ on }">
<div
v-if="enableAmalgamation"
v-on="on"
>
<v-list-item
Expand Down Expand Up @@ -295,6 +296,10 @@ export default class EntityMenu extends Mixins(AllowableActionsMixin) {
return !!GetFeatureFlag('supported-agm-location-chg-entities').includes(this.getLegalType)
}
get enableAmalgamation (): boolean {
return !!GetFeatureFlag('supported-amalgamation-entities').includes(this.getLegalType)
}
/** The tooltip text for AGM Extension list item. Text is different if action item is disabled. */
get agmExtensionToolTipText (): string {
if (!this.isAllowed(AllowableActions.AGM_EXTENSION)) {
Expand Down
1 change: 1 addition & 0 deletions src/utils/feature-flags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const defaultFlagSet: LDFlagSet = {
'enable-digital-credentials': false,
'sentry-enable': false, // by default, no sentry logs
'show-alert-phone-numbers-firm': false,
'supported-amalgamation-entities': [],
'supported-business-summary-entities': [],
'supported-correction-entities': [],
'supported-dissolution-entities': [],
Expand Down
19 changes: 18 additions & 1 deletion tests/unit/EntityMenu.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,22 @@ describe('Entity Menu - View and Change Business Information click tests', () =>
})
})

describe('Entity Menu - Amagamate button tests', () => {
describe('Entity Menu - Amalgamate button tests', () => {
beforeAll(() => {
// override feature flag
vi.spyOn(utils, 'GetFeatureFlag').mockImplementation(flag => {
if (flag === 'supported-agm-extension-entities') return ''
if (flag === 'supported-agm-location-chg-entities') return ''
if (flag === 'supported-amalgamation-entities') return 'BC'
return null
})
})

afterAll(() => {
// restore feature flag
vi.spyOn(utils, 'GetFeatureFlag').mockRestore()
})

it('displays the Amalgamate button', async () => {
businessStore.setLegalType(CorpTypeCd.BC_COMPANY)
businessStore.$state.businessInfo.state = EntityState.ACTIVE
Expand Down Expand Up @@ -559,6 +574,7 @@ describe('Entity Menu - Request AGM Extension click tests', () => {
vi.spyOn(utils, 'GetFeatureFlag').mockImplementation(flag => {
if (flag === 'supported-agm-extension-entities') return 'BEN'
if (flag === 'supported-agm-location-chg-entities') return ''
if (flag === 'supported-amalgamation-entities') return ''
return null
})
})
Expand Down Expand Up @@ -597,6 +613,7 @@ describe('Entity Menu - Request AGM Location Change click tests', () => {
vi.spyOn(utils, 'GetFeatureFlag').mockImplementation(flag => {
if (flag === 'supported-agm-extension-entities') return ''
if (flag === 'supported-agm-location-chg-entities') return 'BEN'
if (flag === 'supported-amalgamation-entities') return ''
return null
})
})
Expand Down

0 comments on commit 8caf1da

Please sign in to comment.