Skip to content

Commit

Permalink
chore(test): add example for #113
Browse files Browse the repository at this point in the history
  • Loading branch information
singerla committed Aug 2, 2024
1 parent f248ff5 commit a9e5ec4
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions __tests__/add-slide-notes.test.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
import Automizer from '../src/automizer';
import { vd } from '../src/helper/general-helper';

test('create presentation and append slides with notes', async () => {
const automizer = new Automizer({
templateDir: `${__dirname}/pptx-templates`,
outputDir: `${__dirname}/pptx-output`
outputDir: `${__dirname}/pptx-output`,
});

const pres = automizer.loadRoot(`RootTemplate.pptx`)
const pres = automizer
.loadRoot(`RootTemplate.pptx`)
.load(`SlideWithNotes.pptx`, 'notes');

pres.addSlide('notes', 1);

const creationIds = await pres.setCreationIds();
// This will print out the first line of a slide note field
// OR the slide title, if there is no slide note present:
console.log(creationIds[0].slides[0].info);

const result = await pres.write(`add-slide-notes.test.pptx`);

expect(result.slides).toBe(2);
Expand Down

0 comments on commit a9e5ec4

Please sign in to comment.