-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added unit tests for amalgamation views + lots of misc. fixes and cle…
…anup
- Loading branch information
1 parent
b67f39b
commit 59db988
Showing
35 changed files
with
416 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import { shallowWrapperFactory } from '../vitest-wrapper-factory' | ||
import { AmalgRegBusinessInfo } from '@/views' | ||
import { AmalgamationRegResources } from '@/resources/' | ||
import OfficeAddresses from '@/components/common/OfficeAddresses.vue' | ||
import BusinessContactInfo from '@/components/common/BusinessContactInfo.vue' | ||
|
||
// Test Case Data | ||
const amalgamationRegularBusinessInfo = [ | ||
{ | ||
entityType: 'BEN' | ||
}, | ||
{ | ||
entityType: 'BC' | ||
}, | ||
{ | ||
entityType: 'ULC' | ||
}, | ||
{ | ||
entityType: 'CC' | ||
} | ||
] | ||
|
||
for (const test of amalgamationRegularBusinessInfo) { | ||
describe(`Amalgamation Regular Business Information for a ${test.entityType}`, () => { | ||
let wrapper: any | ||
|
||
beforeAll(() => { | ||
wrapper = shallowWrapperFactory( | ||
AmalgRegBusinessInfo, | ||
null, | ||
{ | ||
entityType: test.entityType, | ||
tombstone: { keycloakRoles: ['staff'] } | ||
}, | ||
null, | ||
AmalgamationRegResources | ||
) | ||
}) | ||
|
||
afterAll(() => { | ||
wrapper.destroy() | ||
}) | ||
|
||
it('renders the page', () => { | ||
expect(wrapper.find('#amalgamation-regular-business-info').exists()).toBe(true) | ||
}) | ||
|
||
it('displays Registered and Records Office Addresses section', () => { | ||
const section = wrapper.findAll('section').at(0) | ||
expect(section.find('header h2').text()).toBe('Registered and Records Office Addresses') | ||
expect(section.findComponent(OfficeAddresses).exists()).toBe(true) | ||
}) | ||
|
||
it('displays Registered Office Contact Information section', () => { | ||
const section = wrapper.findAll('section').at(1) | ||
expect(section.find('header h2').text()).toBe('Registered Office Contact Information') | ||
expect(wrapper.findComponent(BusinessContactInfo).exists()).toBe(true) | ||
}) | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import { shallowWrapperFactory } from '../vitest-wrapper-factory' | ||
import { AmalgRegInformation } from '@/views' | ||
import { AmalgamationRegResources } from '@/resources/' | ||
import AmalgamatingBusinesses from '@/components/Amalgamation/AmalgamatingBusinesses.vue' | ||
import { ExpandableHelp } from '@bcrs-shared-components/expandable-help' | ||
import ResultingBusinessName from '@/components/Amalgamation/ResultingBusinessName.vue' | ||
import BusinessTypeHelp from '@/components/Amalgamation/BusinessTypeHelp.vue' | ||
|
||
// Test Case Data | ||
const amalgamationRegularBusinessInfo = [ | ||
{ | ||
entityType: 'BEN' | ||
}, | ||
{ | ||
entityType: 'BC' | ||
}, | ||
{ | ||
entityType: 'ULC' | ||
}, | ||
{ | ||
entityType: 'CC' | ||
} | ||
] | ||
|
||
for (const test of amalgamationRegularBusinessInfo) { | ||
describe(`Amalgamation Regular Business Information for a ${test.entityType}`, () => { | ||
let wrapper: any | ||
|
||
beforeAll(() => { | ||
wrapper = shallowWrapperFactory( | ||
AmalgRegInformation, | ||
null, | ||
{ | ||
entityType: test.entityType, | ||
tombstone: { keycloakRoles: ['staff'] } | ||
}, | ||
null, | ||
AmalgamationRegResources | ||
) | ||
}) | ||
|
||
afterAll(() => { | ||
wrapper.destroy() | ||
}) | ||
|
||
it('renders the page', () => { | ||
expect(wrapper.find('#amalgamation-regular-information').exists()).toBe(true) | ||
}) | ||
|
||
it('displays the Amalgamation Businesses section', () => { | ||
const section = wrapper.findAll('section').at(0) | ||
expect(section.find('header h2').text()).toBe('Amalgamating Businesses') | ||
expect(section.find('p').text()).toContain('Add the amalgamating businesses to the list.') | ||
expect(section.findComponent(AmalgamatingBusinesses).exists()).toBe(true) | ||
}) | ||
|
||
it('displays the Resulting Business Name and Type section', () => { | ||
const section = wrapper.findAll('section').at(1) | ||
expect(section.find('header h2').text()).toBe('Resulting Business Name and Type') | ||
expect(section.findComponent(ExpandableHelp).exists()).toBe(true) | ||
expect(section.findComponent(BusinessTypeHelp).exists()).toBe(true) | ||
expect(section.findComponent(ResultingBusinessName).exists()).toBe(true) | ||
}) | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import { shallowWrapperFactory } from '../vitest-wrapper-factory' | ||
import { AmalgRegPeopleRoles } from '@/views' | ||
import { AmalgamationRegResources } from '@/resources/' | ||
import PeopleAndRoles from '@/components/common/PeopleAndRoles.vue' | ||
|
||
// Test Case Data | ||
const amalgamationRegularBusinessInfo = [ | ||
{ | ||
entityType: 'BEN' | ||
}, | ||
{ | ||
entityType: 'BC' | ||
}, | ||
{ | ||
entityType: 'ULC' | ||
}, | ||
{ | ||
entityType: 'CC' | ||
} | ||
] | ||
|
||
for (const test of amalgamationRegularBusinessInfo) { | ||
describe(`Amalgamation Regular Business Information for a ${test.entityType}`, () => { | ||
let wrapper: any | ||
|
||
beforeAll(() => { | ||
wrapper = shallowWrapperFactory( | ||
AmalgRegPeopleRoles, | ||
null, | ||
{ | ||
entityType: test.entityType, | ||
tombstone: { keycloakRoles: ['staff'] } | ||
}, | ||
null, | ||
AmalgamationRegResources | ||
) | ||
}) | ||
|
||
afterAll(() => { | ||
wrapper.destroy() | ||
}) | ||
|
||
it('renders the page', () => { | ||
expect(wrapper.find('#amalgamation-regular-people-roles').exists()).toBe(true) | ||
}) | ||
|
||
it('displays the header and renders the People and Roles component correctly', () => { | ||
expect(wrapper.find('header h2').text()).toBe('1. Add People to your Application') | ||
expect(wrapper.findComponent(PeopleAndRoles).exists()).toBe(true) | ||
}) | ||
}) | ||
} |
Oops, something went wrong.