From 1b07cf57b599af55732d46491a60dc85deed37cc Mon Sep 17 00:00:00 2001 From: Mike Lewis Date: Mon, 30 Jul 2018 09:33:46 +0100 Subject: [PATCH] (chore) Add test for nested text elements --- src/index.test.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/index.test.js b/src/index.test.js index 195ded1..82c5410 100644 --- a/src/index.test.js +++ b/src/index.test.js @@ -262,6 +262,25 @@ describe('#jsx-pdf', () => { }, }); }); + + it('should support nested text elements in the stack', () => { + expect( + toPDFMake( + + + + first + second + + + , + ), + ).toEqual({ + content: { + stack: [{ text: [{ text: 'first' }, { text: 'second' }] }], + }, + }); + }); }); it('should ignore falsy values', () => {