本文整理汇总了TypeScript中response/form/models/statement-of-means/priorityDebtType.PriorityDebtType类的典型用法代码示例。如果您正苦于以下问题:TypeScript PriorityDebtType类的具体用法?TypeScript PriorityDebtType怎么用?TypeScript PriorityDebtType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PriorityDebtType类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: it
it('Should return validation errors for each field that is invalid', () => {
const errors = validator.validateSync(new PriorityDebt(
undefined, new ExpenseSource(PriorityDebtType.MORTGAGE.displayValue, -1, IncomeExpenseSchedule.WEEK),
undefined, new ExpenseSource(PriorityDebtType.RENT.displayValue, -1, IncomeExpenseSchedule.WEEK),
undefined, new ExpenseSource(PriorityDebtType.COUNCIL_TAX_COMMUNITY_CHARGE.displayValue, -1, IncomeExpenseSchedule.WEEK),
undefined, new ExpenseSource(PriorityDebtType.GAS.displayValue, -1, IncomeExpenseSchedule.WEEK),
undefined, new ExpenseSource(PriorityDebtType.ELECTRICITY.displayValue, -1, IncomeExpenseSchedule.WEEK),
undefined, new ExpenseSource(PriorityDebtType.WATER.displayValue, -1, IncomeExpenseSchedule.WEEK),
undefined, new ExpenseSource(PriorityDebtType.MAINTENANCE_PAYMENTS.displayValue, -1, IncomeExpenseSchedule.WEEK)
))
expect(errors.length).to.be.equal(PriorityDebtType.all().length)
PriorityDebtType.all().forEach(value => {
expectValidationError(errors, ValidationErrors.AMOUNT_NON_NEGATIVE_NUMBER_REQUIRED(value.displayValue))
})
})
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:16,代码来源:priorityDebt.ts
示例2: describe
describe('Priority debt type view filter', () => {
PriorityDebtType.all()
.forEach(type => {
it(`should map '${type.value}' to '${type.displayValue}'`, () => {
expect(PriorityDebtTypeViewFilter.render(type.value)).to.equal(type.displayValue)
})
})
it('should throw an error for anything else', () => {
expect(() => PriorityDebtTypeViewFilter.render('SHARK_LOAN')).to.throw(Error)
})
it('should throw an error for null', () => {
expect(() => PriorityDebtTypeViewFilter.render(null)).to.throw('Must be a valid priority debt type')
})
})
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:16,代码来源:priority-debt-type-view-filter.ts
示例3: describe
describe('value of', () => {
it('should return undefined when given undefined', () => {
expect(PriorityDebtType.valueOf(undefined)).to.be.equal(undefined)
})
it('should return undefined when given unknown type', () => {
expect(PriorityDebtType.valueOf('unknown type test')).to.be.equal(undefined)
})
PriorityDebtType.all().forEach(type => {
it(`should return a valid PriorityDebtType for ${type.value}`, () => {
const actual: PriorityDebtType = PriorityDebtType.valueOf(type.value)
expect(actual.value).to.be.equal(type.value)
})
})
})
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:16,代码来源:priorityDebtType.ts
示例4: render
export function render (value: string): string {
if (!value) {
throw new Error('Must be a valid priority debt type')
}
return PriorityDebtType.valueOf(value).displayValue
}
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:6,代码来源:priority-debts-type-view-filter.ts
示例5: it
it('should return an array with all PriorityDebtTypes', () => {
const actual: PriorityDebtType[] = PriorityDebtType.all()
expect(actual).instanceof(Array)
expect(actual.length).to.be.equal(7)
})
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:6,代码来源:priorityDebtType.ts
注:本文中的response/form/models/statement-of-means/priorityDebtType.PriorityDebtType类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论