Skip to content

Commit

Permalink
test: add failing test for christoph-jerolimov#54
Browse files Browse the repository at this point in the history
  • Loading branch information
n1ru4l committed Apr 19, 2020
1 parent 9011b0b commit 142efa5
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/MarkdownView.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -267,4 +267,21 @@ describe('MarkdownView', () => {
'!',
]);
});

it('does render multiple components on the same line', () => {
function CustomComponent({ name }: { name: string }) {
return <span>Hello {name}!</span>;
}
const markdown = `<CustomComponent name="world" /> <b>lmao</b>`;
const testRenderer = TestRenderer.create(
<MarkdownView markdown={markdown} components={{ CustomComponent }} />
);
const testInstance = testRenderer.root;
expect(testInstance.findByType('span').children).toEqual([
'Hello ',
'world',
'!',
]);
expect(testInstance.findByType('b').children).toEqual(['lmao']);
});
});

0 comments on commit 142efa5

Please # to comment.