-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
12570 Add transactional folio number to SP/GP registration filings (#410
) *Issue #:* /bcgov/entity#12570 SP/GP Registration filings: 1. Added Transactional Folio Number component in the Review and Confirm view for premium users. 2. Added unit tests for Registration Review Confirm view as there was no tests for it. 3. Remove business folio number for SP/GP registrations 4. Version number = 4.0.20
- Loading branch information
1 parent
f81152f
commit a1660d9
Showing
5 changed files
with
166 additions
and
48 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
import { shallowWrapperFactory, wrapperFactory } from '../jest-wrapper-factory' | ||
import { getVuexStore } from '@/store' | ||
import { RegistrationReviewConfirm } from '@/views' | ||
import { RegistrationResources } from '@/resources' | ||
|
||
const store = getVuexStore() | ||
|
||
// Test Case Data | ||
const reviewConfirmTestCases = [ | ||
{ | ||
entityType: 'SP', | ||
isPremium: false, | ||
isStaff: false | ||
}, | ||
{ | ||
entityType: 'SP', | ||
isPremium: true, | ||
isStaff: false | ||
}, | ||
{ | ||
entityType: 'SP', | ||
isPremium: false, | ||
isStaff: true | ||
}, | ||
{ | ||
entityType: 'GP', | ||
isPremium: false, | ||
isStaff: false | ||
}, | ||
{ | ||
entityType: 'GP', | ||
isPremium: true, | ||
isStaff: false | ||
}, | ||
{ | ||
entityType: 'GP', | ||
isPremium: false, | ||
isStaff: true | ||
} | ||
] | ||
|
||
for (const test of reviewConfirmTestCases) { | ||
const type = test.isPremium ? 'premium' : test.isStaff ? 'staff' : 'regular' | ||
|
||
describe(`Registration Review and Confirm view for a ${test.entityType} as a ${type} user`, () => { | ||
let wrapper: any | ||
|
||
it('renders the component properly', () => { | ||
wrapper = shallowWrapperFactory( | ||
RegistrationReviewConfirm, | ||
null, | ||
{ | ||
entityType: test.entityType | ||
}, | ||
null, | ||
RegistrationResources | ||
) | ||
|
||
expect(wrapper.find('h2').text()).toBe('Review and Confirm') | ||
}) | ||
|
||
it('displays Documents Delivery section', () => { | ||
wrapper = shallowWrapperFactory( | ||
RegistrationReviewConfirm, | ||
null, | ||
{ | ||
entityType: test.entityType | ||
}, | ||
null, | ||
RegistrationResources | ||
) | ||
|
||
expect(wrapper.find('#document-delivery-section').exists()).toBe(true) | ||
}) | ||
|
||
it('displays Folio number section for premium users', () => { | ||
wrapper = shallowWrapperFactory( | ||
RegistrationReviewConfirm, | ||
null, | ||
{ | ||
entityType: test.entityType, | ||
accountInformation: { accountType: test.isPremium ? 'PREMIUM' : 'BASIC' } | ||
}, | ||
null, | ||
RegistrationResources | ||
) | ||
|
||
expect(wrapper.find('#folio-section').exists()).toBe(test.isPremium) | ||
}) | ||
|
||
it('displays Staff Payment section only for staff', () => { | ||
wrapper = shallowWrapperFactory( | ||
RegistrationReviewConfirm, | ||
null, | ||
{ | ||
entityType: test.entityType, | ||
tombstone: { authRoles: test.isStaff ? ['staff'] : [] } | ||
}, | ||
null, | ||
RegistrationResources | ||
) | ||
|
||
expect(wrapper.find('#staff-payment-section').exists()).toBe(test.isStaff) | ||
}) | ||
}) | ||
} |