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


TypeScript momentFactory.MomentFactory類代碼示例

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


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

示例1: it

      it('should render page when everything is fine', async () => {
        claimStoreServiceMock.resolveRetrieveClaimByExternalId({
          respondedAt: MomentFactory.currentDateTime(),
          countyCourtJudgmentRequestedAt: '2017-10-10T22:45:51.785',
          countyCourtJudgment: {
            defendantDateOfBirth: '1990-11-01',
            paidAmount: 2,
            paymentOption: 'INSTALMENTS',
            repaymentPlan: {
              instalmentAmount: 30,
              firstPaymentDate: '2018-11-11',
              paymentSchedule: 'EVERY_MONTH',
              completionDate: '2019-11-11',
              paymentLength: '12 months'
            },
            ccjType: CountyCourtJudgmentType.DETERMINATION
          },
          claimantResponse: {
            type: ClaimantResponseType.ACCEPTATION,
            amountPaid: 0
          }
        })

        await request(app)
          .get(pagePath)
          .set('Cookie', `${cookieName}=ABC`)
          .expect(res => expect(res).to.be.successful.withText('The repayment plan'))
      })
開發者ID:hmcts,項目名稱:cmc-citizen-frontend,代碼行數:28,代碼來源:repayment-plan-summary.ts

示例2: it

    it('should use provided values', () => {
      const tenDaysAgo = LocalDate.fromMoment(MomentFactory.currentDate().subtract(10, 'days'))
      const row: ReportRow = new ReportRow('John Doe', tenDaysAgo)

      expect(row.expertName).to.equal('John Doe')
      expect(row.reportDate).to.deep.equal(tenDaysAgo)
    })
開發者ID:hmcts,項目名稱:cmc-citizen-frontend,代碼行數:7,代碼來源:reportRow.ts

示例3: it

    it('paymentOption is defined but payment date is in the past', () => {
      const draft: ResponseDraft = validResponseDraft(PaymentType.BY_SET_DATE)
      draft.partialAdmission.paymentIntention.paymentOption.option = PaymentType.BY_SET_DATE
      draft.partialAdmission.paymentIntention.paymentDate =
        new PaymentDate(localDateFrom(MomentFactory.currentDate().add(-10, 'day')))

      expect(WhenWillYouPayTask.isCompleted(draft)).to.be.false
    })
開發者ID:hmcts,項目名稱:cmc-citizen-frontend,代碼行數:8,代碼來源:whenWillYouPayTask.ts

示例4: it

 it('should create a moment with current date', () => {
   const moment = MomentFactory.currentDate()
   assert.isNotNull(moment)
   assert.equal(0, moment.hour())
   assert.equal(0, moment.minute())
   assert.equal(0, moment.second())
   assert.equal(0, moment.millisecond())
 })
開發者ID:hmcts,項目名稱:cmc-citizen-frontend,代碼行數:8,代碼來源:momentFactory.ts

示例5: it

    it('should return CCJ_BY_DETERMINATION_AFTER_SETTLEMENT_BREACHED when the claimant requests a CCJ after settlement terms broken', () => {
      const paymentIntention = {
        paymentOption: PaymentOption.BY_SPECIFIED_DATE,
        paymentDate: MomentFactory.currentDate().subtract(1, 'days')
      }
      claim.settlement = prepareSettlementWithCounterSignature(PaymentIntention.deserialize(paymentIntention), MadeBy.DEFENDANT)
      claim.settlementReachedAt = MomentFactory.currentDate().subtract(1, 'month')
      claim.response = {
        responseType: ResponseType.FULL_ADMISSION,
        paymentIntention: paymentIntention,
        defendant: new Individual().deserialize(individual)
      }
      claim.claimantResponse = baseDeterminationAcceptationClaimantResponseData
      claim.countyCourtJudgmentRequestedAt = MomentFactory.currentDate()

      expect(claim.status).to.be.equal(ClaimStatus.CCJ_BY_DETERMINATION_AFTER_SETTLEMENT_BREACHED)
    })
開發者ID:hmcts,項目名稱:cmc-citizen-frontend,代碼行數:17,代碼來源:claim.ts

示例6: it

      it('should reject a current date', () => {
        const today = MomentFactory.currentDate()

        const errors = validator.validateSync(new WhenDidYouPay(new LocalDate(today.year(), today.month() + 1, today.date()), 'Paid by cheque'))

        expectNumberOfValidationErrors(errors, 1)
        expectValidationError(errors, ValidationErrors.DATE_OUTSIDE_RANGE())
      })
開發者ID:hmcts,項目名稱:cmc-citizen-frontend,代碼行數:8,代碼來源:whenDidYouPay.ts

示例7: it

 it('should return true when settlement is through admissions', () => {
   const paymentIntention = {
     paymentOption: PaymentOption.BY_SPECIFIED_DATE,
     paymentDate: MomentFactory.currentDate()
   }
   const actual: Settlement = prepareSettlement(PaymentIntention.deserialize(paymentIntention))
   expect(actual.isThroughAdmissions()).to.be.eq(true)
 })
開發者ID:hmcts,項目名稱:cmc-citizen-frontend,代碼行數:8,代碼來源:settlement.ts

示例8: it

        it('should display forbidden page', async () => {
          claimStoreServiceMock.resolveRetrieveClaimByExternalId({ moneyReceivedOn: MomentFactory.currentDate().subtract(1, 'day') })

          await request(app)
            .get(pagePath)
            .set('Cookie', `${cookieName}=ABC`)
            .expect(res => expect(res).to.be.forbidden.withText('Forbidden'))
        })
開發者ID:hmcts,項目名稱:cmc-citizen-frontend,代碼行數:8,代碼來源:paid-in-full.ts


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