本文整理汇总了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'))
})
示例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)
})
示例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
})
示例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())
})
示例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)
})
示例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())
})
示例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)
})
示例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'))
})