本文整理匯總了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'))
})