• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript momentFactory.MomentFactory类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript preconditions.checkDefined函数代码示例发布时间:2022-05-25
下一篇:
TypeScript interestUtils.getInterestDetails函数代码示例发布时间:2022-05-25
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap