當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript idam.resolveRetrieveUserFor函數代碼示例

本文整理匯總了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;未經允許,請勿轉載。