本文整理汇总了TypeScript中common/partyType.PartyType类的典型用法代码示例。如果您正苦于以下问题:TypeScript PartyType类的具体用法?TypeScript PartyType怎么用?TypeScript PartyType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PartyType类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it('should accept valid type', () => {
PartyType.all().forEach(type => {
const errors = validator.validateSync(new PartyTypeResponse(type))
expect(errors.length).to.equal(0)
})
})
示例2: checkAccessGuard
function checkAccessGuard (app: any, method: string) {
PartyType.except(PartyType.INDIVIDUAL).forEach(partyType => {
it(`should redirect to dashboard page when defendant type is ${partyType.name.toLocaleLowerCase()}`, async () => {
claimStoreServiceMock.resolveRetrieveClaimByExternalId({
claim: {
...sampleClaimObj.claim,
defendants: [{
...sampleClaimObj.claim.defendants[0],
type: partyType.value
}]
}
})
draftStoreServiceMock.resolveFind('ccj')
await request(app)[method](pagePath)
.set('Cookie', `${cookieName}=ABC`)
.expect(res => expect(res).to.be.redirect.toLocation(DashboardPaths.dashboardPage.uri))
})
})
}
示例3: it
it('should return undefined for unknown type', () => {
expect(PartyType.valueOf('unknown-type')).to.be.undefined
})
示例4: expect
PartyType.all().forEach(type => {
expect(PartyType.valueOf(type.value)).to.be.equal(type)
})
示例5: async
.get(Paths.claimantPartyTypeSelectionPage.uri, async (req: express.Request, res: express.Response, next: express.NextFunction) => {
const draft: Draft<DraftClaim> = res.locals.claimDraft
renderView(new Form(new PartyTypeResponse(draft.document.claimant.partyDetails ? PartyType.valueOf(draft.document.claimant.partyDetails.type) : undefined)), res, next)
})