本文整理汇总了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')
}
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:7,代码来源:hearing-exceptional-circumstances.ts
示例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))
})
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:7,代码来源:expert-evidence.ts
示例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'))
})
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:8,代码来源:not-defendant-in-case-check.ts
示例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'))
})
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:8,代码来源:index.ts
示例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))
})
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:8,代码来源:home.ts
示例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, ''))
})
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:8,代码来源:claim-summary.ts
示例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))
})
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:8,代码来源:authorization-check.ts
示例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)
})
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:8,代码来源:authorization-check.ts
示例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'))
})
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:8,代码来源:claimant-in-case-check.ts
示例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))
})
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:9,代码来源:interest-start-date.ts
注:本文中的test/http-mocks/idam.resolveRetrieveUserFor函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论