Also i would like to ask your suggestions on the procedure, as you know that there is much less community support available for testing jsreport with mocha pdf.
1) Is it possible to get the entire pdf in html
- The reason i am asking that i guess using the html version of the pdf will allow the java-script to find the elements in text easily, so the test-cases could be written seamlessly and accurately.
2) Is the approach i am following is correct approach to test the pdf generated through the jsreport ?
3) Do you have any suggestions regarding the workflow ?
Here is the basic code that i have used to render data from the jsreport :
it('should have template', () => {
return jsreport.render({
template: { pageRanges : 1-3, name: 'invoice' },
data: { }
}).then((resp) => {
pdf(resp.content).then(function (data) {
console.log("===========================================================")
console.log("Number of Pages : "+data.numpages)
console.log("===========================================================")
console.log("Rendering Page : "+data.numrender)
console.log("===========================================================")
console.log("Basic Information : "+data.info)
console.log("===========================================================")
console.log("Metadata : "+data.metadata)
console.log("===========================================================")
console.log("Version : "+data.version)
console.log("===========================================================")
console.log("Text : "+data.text)
});
}).catch((e) => {
console.error(e)
})
})