本文整理汇总了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))
})