本文整理匯總了TypeScript中test/http-mocks/idam.resolveRetrieveUserFor函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript resolveRetrieveUserFor函數的具體用法?TypeScript resolveRetrieveUserFor怎麽用?TypeScript resolveRetrieveUserFor使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了resolveRetrieveUserFor函數的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: setupMocks
function setupMocks (claimant: PartyType, defendant: PartyType, currentParty: MadeBy) {
const claimObject = RouteHelper.createClaim(claimant, defendant, currentParty)
idamServiceMock.resolveRetrieveUserFor(currentParty === MadeBy.CLAIMANT ? claimObject.submitterId : claimObject.defendantId, 'citizen')
claimStoreServiceMock.resolveRetrieveClaimByExternalId(claimObject)
draftStoreServiceMock.resolveFind('directionsQuestionnaire')
draftStoreServiceMock.resolveFind('response')
}
示例2: it
it(`should redirect to dashboard page when DQ is not enabled for claim`, async () => {
idamServiceMock.resolveRetrieveUserFor('1', 'citizen')
claimStoreServiceMock.resolveRetrieveClaimByExternalId()
await request(app)[method](pagePath)
.set('Cookie', `${cookieName}=ABC`)
.expect(res => expect(res).to.be.redirect.toLocation(DashboardPaths.dashboardPage.uri))
})
示例3: it
it(`for ${method} should return 403 and render forbidden error page not defendant in case`, async () => {
claimStoreServiceMock.resolveRetrieveClaimByExternalId()
idamServiceMock.resolveRetrieveUserFor('2', 'citizen')
await request(app)[method](pagePath)
.set('Cookie', `${cookieName}=ABC`)
.expect(res => expect(res).to.be.forbidden.withText('Forbidden'))
})
示例4: it
it('should render page when everything is fine', async () => {
idamServiceMock.resolveRetrieveUserFor('1')
await request(app)
.get(pagePath)
.set('Cookie', `${cookieName}=ABC;`)
.expect(res => expect(res).to.be.successful.withText('Find out if you can make a claim using this service'))
})
示例5: it
it('should redirect to start claim page', async () => {
idamServiceMock.resolveRetrieveUserFor('1', 'citizen')
await request(app)
.get(AppPaths.homePage.uri)
.set('Cookie', `${cookieName}=ABC`)
.expect(res => expect(res).to.be.redirect.toLocation(AppPaths.receiver.uri))
})
示例6: it
it('should clear session cookie when everything is fine', async () => {
idamServiceMock.resolveRetrieveUserFor('1', 'citizen', 'letter-holder')
await request(app)
.post(Paths.claimSummaryPage.uri)
.set('Cookie', `${cookieName}=ABC`)
.expect(res => expect(res).to.have.cookie(cookieName, ''))
})
示例7: it
it('should redirect to access denied page when user not in required role', async () => {
mock.cleanAll()
idamServiceMock.resolveRetrieveUserFor('1', 'divorce-private-beta')
await request.agent(app)[method](pagePath)
.set('Cookie', `${cookieName}=ABC`)
.expect(res => expect(res).redirect.toLocation(accessDeniedPage))
})
示例8: it
it('should render page when user session is active', async () => {
mock.cleanAll()
idamServiceMock.resolveRetrieveUserFor('1')
await request(app)[method](pagePath)
.set('Cookie', `${cookieName}=ABC`)
.expect(res => expect(res).to.be.successful)
})
示例9: it
it(`for ${method} should return 403 and render forbidden error page when user is not claimant on the case`, async () => {
idamServiceMock.resolveRetrieveUserFor('1', 'citizen')
claimStoreServiceMock.resolveRetrieveClaimByExternalId({ submitterId: '999', defendantId: '1' })
await request(app)[method](pagePath)
.set('Cookie', `${cookieName}=ABC`)
.expect(res => expect(res).to.be.forbidden.withText('Forbidden'))
})
示例10: it
it('should render page when everything is fine', async () => {
idamServiceMock.resolveRetrieveUserFor('1', 'citizen')
draftStoreServiceMock.resolveFind('claim')
await request(app)
.get(pagePath)
.set('Cookie', `${cookieName}=ABC`)
.expect(res => expect(res).to.be.successful.withText(pageContent))
})