Skip to content

Commit a294538

Browse files
committed
test: default charts, vert. lines, bubbles (WIP)
1 parent 880f1ac commit a294538

File tree

4 files changed

+42
-0
lines changed

4 files changed

+42
-0
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import Automizer, { modify } from '../src/index';
2+
3+
test('create presentation, add and modify a vertical lines chart.', async () => {
4+
const automizer = new Automizer({
5+
templateDir: `${__dirname}/pptx-templates`,
6+
outputDir: `${__dirname}/pptx-output`
7+
});
8+
9+
const pres = automizer
10+
.loadRoot(`RootTemplate.pptx`)
11+
.load(`ChartLinesVertical.pptx`, 'charts');
12+
13+
const data3 = {
14+
series: [
15+
{ label: 'series s1' },
16+
{ label: 'series s2' },
17+
{ label: 'series s3' }
18+
],
19+
categories: [
20+
{ label: 'item test r1', yValue: 10, values: [10, 45, 5] },
21+
{ label: 'item test r2', yValue: 9, values: [20, 35, 6] },
22+
{ label: 'item test r3', yValue: 8, values: [15, 25, 7] },
23+
{ label: 'item test r4', yValue: 7, values: [12, 15, 8] },
24+
{ label: 'item test r5', yValue: 6, values: [8, 8, 9] },
25+
{ label: 'item test r6', yValue: 5, values: [9, 7, 10] },
26+
{ label: 'item test r7', yValue: 4, values: [6, 6, 11] },
27+
{ label: 'item test r8', yValue: 3, values: [11, 5, 12] },
28+
{ label: 'item test r9', yValue: 2, values: [12, 4, 13] },
29+
{ label: 'item test r10', yValue: 1, values: [19, 3, 14] },
30+
],
31+
}
32+
33+
const result = await pres
34+
.addSlide('charts', 1, (slide) => {
35+
slide.modifyElement('DotMatrix', [
36+
modify.setChartVerticalLines(data3),
37+
]);
38+
})
39+
.write(`modify-chart-vertical-lines.test.pptx`)
40+
41+
expect(result.charts).toBe(2);
42+
});
47.9 KB
Binary file not shown.
48.4 KB
Binary file not shown.
47.2 KB
Binary file not shown.

0 commit comments

Comments
 (0)