Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Added amalgamation FF check #610

Merged
merged 3 commits into from
Jan 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
severinbeauvais marked this conversation as resolved.
Show resolved Hide resolved
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
Loading