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


TypeScript draft-store.resolveSave函數代碼示例

本文整理匯總了TypeScript中test/http-mocks/draft-store.resolveSave函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript resolveSave函數的具體用法?TypeScript resolveSave怎麽用?TypeScript resolveSave使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了resolveSave函數的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: it

 it('when form is valid should render page', async () => {
   draftStoreServiceMock.resolveSave()
   await request(app)
     .post(pagePath)
     .set('Cookie', `${cookieName}=ABC`)
     .send(validFormData)
     .expect(res => expect(res).to.be.redirect
       .toLocation(Paths.taskListPage.evaluateUri({ externalId: externalId })))
 })
開發者ID:hmcts,項目名稱:cmc-citizen-frontend,代碼行數:9,代碼來源:already-paid.ts

示例2: it

        it('should redirect to interest page when form is valid, amount within limit and everything is fine', async () => {
          draftStoreServiceMock.resolveFind('claim')
          draftStoreServiceMock.resolveSave()

          await request(app)
            .post(ClaimPaths.amountPage.uri)
            .set('Cookie', `${cookieName}=ABC`)
            .send({ rows: [{ reason: 'Damaged roof', amount: '299' }] })
            .expect(res => expect(res).to.be.redirect.toLocation(ClaimPaths.interestPage.uri))
        })
開發者ID:hmcts,項目名稱:cmc-citizen-frontend,代碼行數:10,代碼來源:amount.ts

示例3: it

 it('should redirect to mobile number page when everything is fine with no trading as name', async () => {
   const noTradingAsNameInput = { ...input, ...{ businessName: '' } }
   draftStoreServiceMock.resolveFind('claim')
   draftStoreServiceMock.resolveSave()
   await request(app)
     .post(ClaimPaths.claimantSoleTraderOrSelfEmployedDetailsPage.uri)
     .set('Cookie', `${cookieName}=ABC`)
     .send(noTradingAsNameInput)
     .expect(res => expect(res).to.be.redirect.toLocation(ClaimPaths.claimantMobilePage.uri))
 })
開發者ID:hmcts,項目名稱:cmc-citizen-frontend,代碼行數:10,代碼來源:claimant-soleTrader-details.ts

示例4: it

      it('should redirect to task list when no email address is given', async () => {
        draftStoreServiceMock.resolveFind('claim')
        draftStoreServiceMock.resolveSave()

        await request(app)
          .post(ClaimPaths.defendantEmailPage.uri)
          .set('Cookie', `${cookieName}=ABC`)
          .send({ address: '' })
          .expect(res => expect(res).to.be.redirect.toLocation(ClaimPaths.taskListPage.uri))
      })
開發者ID:hmcts,項目名稱:cmc-citizen-frontend,代碼行數:10,代碼來源:defendant-email.ts

示例5: it

      it('should redirect to total page when form is valid, settled or judgment is selected and everything is fine', async () => {
        draftStoreServiceMock.resolveFind('claim')
        draftStoreServiceMock.resolveSave()

        await request(app)
          .post(pagePath)
          .set('Cookie', `${cookieName}=ABC`)
          .send({ option: InterestEndDateOption.SETTLED_OR_JUDGMENT })
          .expect(res => expect(res).to.be.redirect.toLocation(ClaimPaths.totalPage.uri))
      })
開發者ID:hmcts,項目名稱:cmc-citizen-frontend,代碼行數:10,代碼來源:interest-end-date.ts

示例6: it

 it('should redirect to data of birth page when no trading as provided', async () => {
   const invalidCorrespondenceAddressInput = { ...input, ...{ businessName: '' } }
   draftStoreServiceMock.resolveFind('claim')
   draftStoreServiceMock.resolveSave()
   await request(app)
     .post(ClaimPaths.defendantSoleTraderOrSelfEmployedDetailsPage.uri)
     .set('Cookie', `${cookieName}=ABC`)
     .send(invalidCorrespondenceAddressInput)
     .expect(res => expect(res).to.be.redirect.toLocation(ClaimPaths.defendantEmailPage.uri))
 })
開發者ID:hmcts,項目名稱:cmc-citizen-frontend,代碼行數:10,代碼來源:defendant-sole-trader-details.ts

示例7: it

      it('should redirect to task list when form is valid and number is provided', async () => {
        draftStoreServiceMock.resolveFind('claim')
        draftStoreServiceMock.resolveSave()

        await request(app)
          .post(ClaimPaths.claimantMobilePage.uri)
          .set('Cookie', `${cookieName}=ABC`)
          .send({ number: '07000000000' })
          .expect(res => expect(res).to.be.redirect.toLocation(ClaimPaths.taskListPage.uri))
      })
開發者ID:hmcts,項目名稱:cmc-citizen-frontend,代碼行數:10,代碼來源:claimant-mobile.ts

示例8: it

      it('should redirect to timeline when form is valid and everything is fine', async () => {
        draftStoreServiceMock.resolveFind('claim')
        draftStoreServiceMock.resolveSave()

        await request(app)
          .post(pagePath)
          .set('Cookie', `${cookieName}=ABC`)
          .send({ rows: [{ date: 'may', description: 'ok' }] })
          .expect(res => expect(res).to.be.redirect.toLocation(ClaimPaths.evidencePage.uri))
      })
開發者ID:hmcts,項目名稱:cmc-citizen-frontend,代碼行數:10,代碼來源:timeline.ts

示例9: it

      it('should redirect to total page when form is valid, no is selected and everything is fine', async () => {
        draftStoreServiceMock.resolveFind('claim')
        draftStoreServiceMock.resolveSave()

        await request(app)
          .post(pagePath)
          .set('Cookie', `${cookieName}=ABC`)
          .send({ option: YesNoOption.NO.option })
          .expect(res => expect(res).to.be.redirect.toLocation(ClaimPaths.totalPage.uri))
      })
開發者ID:hmcts,項目名稱:cmc-citizen-frontend,代碼行數:10,代碼來源:interest.ts


注:本文中的test/http-mocks/draft-store.resolveSave函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。