-
Notifications
You must be signed in to change notification settings - Fork 54
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
18534 Amalg unit tests + small fixes + more typing #596
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,7 +38,7 @@ | |
<h4>Incorporation Complete</h4> | ||
|
||
<p> | ||
{{ getLegalName || 'A Numbered Benefit Company' }} has been successfully incorporated. | ||
{{ companyName }} has been successfully incorporated. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Great catch Sev! Removing that hard-coded part. |
||
</p> | ||
|
||
<p> | ||
|
@@ -84,6 +84,7 @@ export default class IncorporationApplication extends Vue { | |
@Prop({ required: true }) readonly filing!: ApiFilingIF | ||
@Prop({ required: true }) readonly index!: number | ||
|
||
@Getter(useBusinessStore) getEntityName!: string | ||
@Getter(useBusinessStore) getLegalName!: string | ||
@Getter(useConfigurationStore) getMyBusinessRegistryUrl!: string | ||
|
||
|
@@ -110,6 +111,13 @@ export default class IncorporationApplication extends Vue { | |
) | ||
} | ||
|
||
/** The legal name or numbered description of the new company. */ | ||
get companyName (): string { | ||
if (this.getLegalName) return this.getLegalName | ||
if (this.getEntityName) return `A ${this.getEntityName}` | ||
return 'Unknown Name' | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
returnToMyBusinessRegistry (): void { | ||
navigate(this.getMyBusinessRegistryUrl) | ||
} | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I just reorganized some of the getters in here. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -142,13 +142,23 @@ export const useBusinessStore = defineStore('business', { | |
}, | ||
|
||
/** Is True if entity is a Benefit Company. */ | ||
isBComp (state: BusinessStateIF): boolean { | ||
return (state.businessInfo.legalType === CorpTypeCd.BENEFIT_COMPANY) | ||
isBComp (): boolean { | ||
return (this.getLegalType === CorpTypeCd.BENEFIT_COMPANY) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ... And I used the getter for legal type instead of extracting it from the state. |
||
}, | ||
|
||
/** Is True if entity is a BC Company. */ | ||
isBcCompany (state: BusinessStateIF): boolean { | ||
return (state.businessInfo.legalType === CorpTypeCd.BC_COMPANY) | ||
isBcCompany (): boolean { | ||
return (this.getLegalType === CorpTypeCd.BC_COMPANY) | ||
}, | ||
|
||
/** Is True if entity is a BC Community Contribution Company. */ | ||
isCcc (): boolean { | ||
return (this.getLegalType === CorpTypeCd.BC_CCC) | ||
}, | ||
|
||
/** Is True if entity is a BC ULC Company. */ | ||
isUlc (): boolean { | ||
return (this.getLegalType === CorpTypeCd.BC_ULC_COMPANY) | ||
}, | ||
|
||
/** Is True if entity is a BEN/BC/CCC/ULC. */ | ||
|
@@ -161,19 +171,24 @@ export const useBusinessStore = defineStore('business', { | |
) | ||
}, | ||
|
||
/** Is True if entity is a BC Community Contribution Company. */ | ||
isCcc (state: BusinessStateIF): boolean { | ||
return (state.businessInfo.legalType === CorpTypeCd.BC_CCC) | ||
/** Is True if entity is a Cooperative. */ | ||
isCoop (): boolean { | ||
return (this.getLegalType === CorpTypeCd.COOP) | ||
}, | ||
|
||
/** Is True if entity is a Cooperative. */ | ||
isCoop (state: BusinessStateIF): boolean { | ||
return (state.businessInfo.legalType === CorpTypeCd.COOP) | ||
/** Is True if entity is a Corporation. */ | ||
isCorp (): boolean { | ||
return (this.getLegalType === CorpTypeCd.CORPORATION) | ||
}, | ||
|
||
/** Is True if entity is a General Partnership. */ | ||
isPartnership (): boolean { | ||
return (this.getLegalType === CorpTypeCd.PARTNERSHIP) | ||
}, | ||
|
||
/** Is True if entity is a BC Corporation. */ | ||
isCorp (state: BusinessStateIF): boolean { | ||
return (state.businessInfo.legalType === CorpTypeCd.CORPORATION) | ||
/** Is True if entity is a Sole Proprietorship. */ | ||
isSoleProp (): boolean { | ||
return (this.getLegalType === CorpTypeCd.SOLE_PROP) | ||
}, | ||
|
||
/** Is True if entity is a Sole Proprietorship or General Partnership. */ | ||
|
@@ -194,21 +209,6 @@ export const useBusinessStore = defineStore('business', { | |
/** Is True if business is in liquidation. */ | ||
isLiquidation (): boolean { | ||
return (this.getBusinessState === EntityState.LIQUIDATION) | ||
}, | ||
|
||
/** Is True if entity is a General Partnership. */ | ||
isPartnership (): boolean { | ||
return (this.getLegalType === CorpTypeCd.PARTNERSHIP) | ||
}, | ||
|
||
/** Is True if entity is a Sole Proprietorship. */ | ||
isSoleProp (): boolean { | ||
return (this.getLegalType === CorpTypeCd.SOLE_PROP) | ||
}, | ||
|
||
/** Is True if entity is a BC ULC Company. */ | ||
isUlc (): boolean { | ||
return (this.getLegalType === CorpTypeCd.BC_ULC_COMPANY) | ||
} | ||
}, | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -173,7 +173,6 @@ describe('AGM Extension view', () => { | |
}) | ||
|
||
// simulate eligible data and valid component | ||
// *** TODO: add more data here and below when verifying payload | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not needed. |
||
wrapper.setData({ | ||
data: { isEligible: true }, | ||
extensionRequestValid: true | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import Vue from 'vue' | ||
import Vuetify from 'vuetify' | ||
import { Wrapper, mount } from '@vue/test-utils' | ||
import { createPinia, setActivePinia } from 'pinia' | ||
import { useBusinessStore } from '@/stores' | ||
import { FilingStatus, FilingTypes } from '@/enums' | ||
import AmalgamationFiling from '@/components/Dashboard/FilingHistoryList/filings/AmalgamationFiling.vue' | ||
|
||
// mock the console.warn function to hide "[Vuetify] The v-expansion-panel component must be used inside a | ||
// v-expansion-panels" | ||
console.warn = vi.fn() | ||
|
||
Vue.use(Vuetify) | ||
|
||
const vuetify = new Vuetify({}) | ||
setActivePinia(createPinia()) | ||
const businessStore = useBusinessStore() | ||
|
||
describe('Amalgamation Filing', () => { | ||
let wrapper: Wrapper<AmalgamationFiling> | ||
|
||
beforeAll(() => { | ||
// init store | ||
businessStore.setLegalName('MY COMPANY') | ||
|
||
wrapper = mount(AmalgamationFiling, { | ||
vuetify, | ||
propsData: { | ||
filing: { | ||
comments: [], | ||
commentsCount: 0, | ||
commentsLink: null, | ||
displayName: 'Amalgamation Application - Regular', | ||
documents: [], | ||
documentsLink: 'dummy_link', | ||
data: {}, | ||
effectiveDate: new Date('2021-01-01 08:00:00 GMT'), | ||
name: FilingTypes.AMALGAMATION, | ||
status: FilingStatus.COMPLETED, | ||
submittedDate: new Date('2021-01-01 08:00:00 GMT'), | ||
submitter: 'John Doe' | ||
}, | ||
index: 0 | ||
} | ||
}) | ||
}) | ||
|
||
afterAll(() => { | ||
wrapper.destroy() | ||
}) | ||
|
||
it('Displays expected content with a valid filing', () => { | ||
// verify content | ||
expect(wrapper.find('.item-header-title').text()).toBe('Amalgamation Application - Regular') | ||
expect(wrapper.find('.item-header-subtitle').text()).toContain('FILED AND PAID') | ||
expect(wrapper.find('.item-header-subtitle').text()).toContain('(filed by John Doe on Jan 1, 2021)') | ||
expect(wrapper.find('.item-header-subtitle').text()).toContain('EFFECTIVE as of Jan 1, 2021') | ||
|
||
// FUTURE: expand the panel and verify content | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tried for a while to be able to expand this item and verify the content but was unable. |
||
}) | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the same as for Incorporation Applications.