本文整理汇总了TypeScript中test/http-mocks/draft-store.resolveSave函数的典型用法代码示例。如果您正苦于以下问题:TypeScript resolveSave函数的具体用法?TypeScript resolveSave怎么用?TypeScript resolveSave使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了resolveSave函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it('when form is valid should render page', async () => {
draftStoreServiceMock.resolveSave()
await request(app)
.post(pagePath)
.set('Cookie', `${cookieName}=ABC`)
.send(validFormData)
.expect(res => expect(res).to.be.redirect
.toLocation(Paths.taskListPage.evaluateUri({ externalId: externalId })))
})
示例2: it
it('should redirect to interest page when form is valid, amount within limit and everything is fine', async () => {
draftStoreServiceMock.resolveFind('claim')
draftStoreServiceMock.resolveSave()
await request(app)
.post(ClaimPaths.amountPage.uri)
.set('Cookie', `${cookieName}=ABC`)
.send({ rows: [{ reason: 'Damaged roof', amount: '299' }] })
.expect(res => expect(res).to.be.redirect.toLocation(ClaimPaths.interestPage.uri))
})
示例3: it
it('should redirect to mobile number page when everything is fine with no trading as name', async () => {
const noTradingAsNameInput = { ...input, ...{ businessName: '' } }
draftStoreServiceMock.resolveFind('claim')
draftStoreServiceMock.resolveSave()
await request(app)
.post(ClaimPaths.claimantSoleTraderOrSelfEmployedDetailsPage.uri)
.set('Cookie', `${cookieName}=ABC`)
.send(noTradingAsNameInput)
.expect(res => expect(res).to.be.redirect.toLocation(ClaimPaths.claimantMobilePage.uri))
})
示例4: it
it('should redirect to task list when no email address is given', async () => {
draftStoreServiceMock.resolveFind('claim')
draftStoreServiceMock.resolveSave()
await request(app)
.post(ClaimPaths.defendantEmailPage.uri)
.set('Cookie', `${cookieName}=ABC`)
.send({ address: '' })
.expect(res => expect(res).to.be.redirect.toLocation(ClaimPaths.taskListPage.uri))
})
示例5: it
it('should redirect to total page when form is valid, settled or judgment is selected and everything is fine', async () => {
draftStoreServiceMock.resolveFind('claim')
draftStoreServiceMock.resolveSave()
await request(app)
.post(pagePath)
.set('Cookie', `${cookieName}=ABC`)
.send({ option: InterestEndDateOption.SETTLED_OR_JUDGMENT })
.expect(res => expect(res).to.be.redirect.toLocation(ClaimPaths.totalPage.uri))
})
示例6: it
it('should redirect to data of birth page when no trading as provided', async () => {
const invalidCorrespondenceAddressInput = { ...input, ...{ businessName: '' } }
draftStoreServiceMock.resolveFind('claim')
draftStoreServiceMock.resolveSave()
await request(app)
.post(ClaimPaths.defendantSoleTraderOrSelfEmployedDetailsPage.uri)
.set('Cookie', `${cookieName}=ABC`)
.send(invalidCorrespondenceAddressInput)
.expect(res => expect(res).to.be.redirect.toLocation(ClaimPaths.defendantEmailPage.uri))
})
示例7: it
it('should redirect to task list when form is valid and number is provided', async () => {
draftStoreServiceMock.resolveFind('claim')
draftStoreServiceMock.resolveSave()
await request(app)
.post(ClaimPaths.claimantMobilePage.uri)
.set('Cookie', `${cookieName}=ABC`)
.send({ number: '07000000000' })
.expect(res => expect(res).to.be.redirect.toLocation(ClaimPaths.taskListPage.uri))
})
示例8: it
it('should redirect to timeline when form is valid and everything is fine', async () => {
draftStoreServiceMock.resolveFind('claim')
draftStoreServiceMock.resolveSave()
await request(app)
.post(pagePath)
.set('Cookie', `${cookieName}=ABC`)
.send({ rows: [{ date: 'may', description: 'ok' }] })
.expect(res => expect(res).to.be.redirect.toLocation(ClaimPaths.evidencePage.uri))
})
示例9: it
it('should redirect to total page when form is valid, no is selected and everything is fine', async () => {
draftStoreServiceMock.resolveFind('claim')
draftStoreServiceMock.resolveSave()
await request(app)
.post(pagePath)
.set('Cookie', `${cookieName}=ABC`)
.send({ option: YesNoOption.NO.option })
.expect(res => expect(res).to.be.redirect.toLocation(ClaimPaths.totalPage.uri))
})