Skip to content

Commit

Permalink
Merge pull request #5 from mtlewis/chore/cover-stacked-text
Browse files Browse the repository at this point in the history
(chore) Add test for nested text elements
  • Loading branch information
mtlewis authored Jul 30, 2018
2 parents e1db088 + 1b07cf5 commit 0011470
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,25 @@ describe('#jsx-pdf', () => {
},
});
});

it('should support nested text elements in the stack', () => {
expect(
toPDFMake(
<document>
<content>
<text>
<text>first</text>
<text>second</text>
</text>
</content>
</document>,
),
).toEqual({
content: {
stack: [{ text: [{ text: 'first' }, { text: 'second' }] }],
},
});
});
});

it('should ignore falsy values', () => {
Expand Down

0 comments on commit 0011470

Please sign in to comment.