import { createMockLayout } from '../../../../../../screenshotting/server/layouts/mock' ; import { PdfMaker } from '../' ; const imageBase64 = Buffer . from ( `iVBORw0KGgoAAAANSUhEUgAAAOEAAADhCAMAAAAJbSJIAAAAGFBMVEXy8vJpaWn7+/vY2Nj39/cAAACcnJzx8fFvt0oZAAAAi0lEQVR4nO3SSQoDIBBFwR7U3P/GQXKEIIJULXr9H3TMrHhX5Yysvj3jjM8+XRnVa9wec8QuHKv3h74Z+PNyGwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/xu3Bxy026rXu4ljdUVW395xUFfGzLo946DK+QW+bgCTFcecSAAAAABJRU5ErkJggg==` , 'base64' ) ; describe ( 'PdfMaker' , ( ) => { let layout ; let pdf ; beforeEach ( ( ) => { layout = createMockLayout ( ) ; pdf = new PdfMaker ( layout , undefined ) ; } ) ; describe ( 'getBuffer' , ( ) => { it ( 'should generate PDF buffer' , async ( ) => { pdf . setTitle ( 'the best PDF in the world' ) ; pdf . addImage ( imageBase64 , { title : 'first viz' , description : '☃️' } ) ; pdf . addImage ( imageBase64 , { title : 'second viz' , description : '❄️' } ) ; pdf . generate ( ) ; await expect ( pdf . getBuffer ( ) ) . resolves . toBeInstanceOf ( Buffer ) ; } ) ; } ) ; } ) ;