本文整理匯總了TypeScript中shared/momentFactory.MomentFactory.parse方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript MomentFactory.parse方法的具體用法?TypeScript MomentFactory.parse怎麽用?TypeScript MomentFactory.parse使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類shared/momentFactory.MomentFactory
的用法示例。
在下文中一共展示了MomentFactory.parse方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: it
it('should extract the correct state for the claim issued', () => {
const claim: Claim = new Claim().deserialize({
...sampleClaimIssueObj,
response: {
responseType: ResponseType.FULL_DEFENCE,
freeMediation: FreeMediationOption.NO
},
settlement: {
partyStatements: [
{
madeBy: 'DEFENDANT',
type: 'COUNTERSIGNATURE'
},
{
madeBy: 'CLAIMANT',
type: 'ACCEPTATION'
},
{
type: 'OFFER',
madeBy: 'DEFENDANT',
offer: {
content: 'test',
completionDate: MomentFactory.parse('2019-05-01')
}
}
]
},
settlementReachedAt: MomentFactory.parse('2019-03-01')
})
let claimState = fullDefenceTransitions(claim)
claimState.findState(claimState)
expect(claimState.state).to.equal('fd-settled-with-agreement')
})
示例2: deserialize
deserialize (input?: any): RepaymentPlan {
if (input) {
this.instalmentAmount = input.instalmentAmount
this.firstPaymentDate = MomentFactory.parse(input.firstPaymentDate)
this.paymentSchedule = PaymentSchedule.of(input.paymentSchedule)
if (input.completionDate) {
this.completionDate = MomentFactory.parse(input.completionDate)
}
this.paymentLength = input.paymentLength
}
return this
}
示例3: it
it('should render page when everything is fine and CLAIMANT date is accepted', async () => {
claimStoreServiceMock.resolveRetrieveClaimByExternalId(defendantFullAdmissionResponse)
draftStoreServiceMock.resolveFind('claimantResponse', {
courtDetermination: {
decisionType: 'CLAIMANT',
courtDecision: {
paymentOption: 'BY_SPECIFIED_DATE',
paymentDate: MomentFactory.parse('2018-11-01'),
repaymentPlan: undefined }
},
alternatePaymentMethod: {
paymentOption: {
option: {
value: 'BY_SPECIFIED_DATE',
displayValue: 'By set date'
}
},
paymentDate: new PaymentDate(new LocalDate(2018,11,1)),
paymentPlan: undefined
}
})
await request(app)
.get(pagePath)
.set('Cookie', `${cookieName}=ABC`)
.expect(res => expect(res).to.be.successful.withText('The defendant canât pay by your proposed date'))
})
示例4: retrieveDateOfBirthOfDefendant
get retrieveDateOfBirthOfDefendant (): DateOfBirth {
if (this.response && this.response.defendant.type === PartyType.INDIVIDUAL.value) {
const defendantDateOfBirth: Moment = MomentFactory.parse((this.response.defendant as Individual).dateOfBirth)
return new DateOfBirth(true, LocalDate.fromMoment(defendantDateOfBirth))
}
return undefined
}
示例5: deserialize
public deserialize (input: any): CountyCourtJudgment {
if (input) {
if (input.defendantDateOfBirth) {
this.defendantDateOfBirth = MomentFactory.parse(input.defendantDateOfBirth)
}
this.paymentOption = input.paymentOption
this.paidAmount = toNumberOrUndefined(input.paidAmount)
this.repaymentPlan = input.repaymentPlan ? new RepaymentPlan().deserialize(input.repaymentPlan) : undefined
this.payBySetDate = input.payBySetDate ? MomentFactory.parse(input.payBySetDate) : undefined
this.statementOfTruth = new StatementOfTruth().deserialize(input.statementOfTruth)
if (input.ccjType) {
this.ccjType = input.ccjType
}
}
return this
}
示例6: deserialize
deserialize (input: any): Offer {
if (input) {
this.content = input.content
this.completionDate = MomentFactory.parse(input.completionDate)
this.paymentIntention = PaymentIntention.deserialize(input.paymentIntention)
}
return this
}
示例7: deserialize
static deserialize (input: any): PaymentIntention {
if (!input) {
return input
}
const instance = new PaymentIntention()
instance.paymentOption = input.paymentOption
instance.paymentDate = input.paymentDate && MomentFactory.parse(input.paymentDate)
instance.repaymentPlan = input.repaymentPlan && {
instalmentAmount: input.repaymentPlan.instalmentAmount,
firstPaymentDate: MomentFactory.parse(input.repaymentPlan.firstPaymentDate),
paymentSchedule: input.repaymentPlan.paymentSchedule,
completionDate: input.repaymentPlan.completionDate && MomentFactory.parse(input.repaymentPlan.completionDate),
paymentLength: input.repaymentPlan.paymentLength
}
return instance
}
示例8: it
it('should redirect to ccj error page', async () => {
idamServiceMock.resolveRetrieveUserFor('1', 'citizen', 'letter-holder')
claimStoreServiceMock.resolveRetrieveByLetterHolderId(
'000MC000', { countyCourtJudgmentRequestedAt: MomentFactory.parse('2010-10-10') }
)
await request(app)
.get(Paths.claimSummaryPage.uri)
.set('Cookie', `${cookieName}=ABC;state = 000MC000`)
.expect(res => expect(res).to.be.redirect.toLocation(ErrorPaths.ccjRequestedHandoffPage.uri))
})
示例9: it
it('should convert payment in full by specified date', () => {
const paymentIntention = PaymentIntention.deserialize({
paymentOption: { option: PaymentType.BY_SET_DATE },
paymentDate: { date: new LocalDate(2018,12,31) }
})
const result = paymentIntention.toDomainInstance()
expect(result.paymentOption).to.be.equal('BY_SPECIFIED_DATE')
expect(result.paymentDate.toISOString()).to.be.deep.equal(MomentFactory.parse('2018-12-31').toISOString())
expect(result.repaymentPlan).to.be.undefined
})