Skip to content

Commit

Permalink
test(react): Text with <BR>
Browse files Browse the repository at this point in the history
with & without markdown
  • Loading branch information
dpinol authored and manuelfidalgo committed Dec 24, 2020
1 parent da556a3 commit e8401a1
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,32 @@ Array [
]
`;

exports[`Text Component Text with <BR>: markdown disabled 1`] = `
<message
delay={0}
markdown={0}
type="text"
typing={0}
>
hi
<br />
bye
</message>
`;
exports[`Text Component Text with <BR>: markdown enabled 1`] = `
<message
delay={0}
markdown={1}
type="text"
typing={0}
>
hi
&lt;br&gt;
bye
</message>
`;
exports[`Text Component Text with 1 button 1`] = `
<message
delay={0}
Expand Down
24 changes: 24 additions & 0 deletions packages/botonic-react/tests/components/text.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,30 @@ describe('Text Component', () => {
expect(tree).toMatchSnapshot()
})

test('Text with <BR>: markdown disabled', () => {
const sut = (
<Text markdown={0}>
hi
<br />
bye
</Text>
)
const tree = renderToJSON(sut)
expect(tree).toMatchSnapshot()
})

test('Text with <BR>: markdown enabled', () => {
const sut = (
<Text>
hi
<br />
bye
</Text>
)
const tree = renderToJSON(sut)
expect(tree).toMatchSnapshot()
})

test('Text with 1 button', () => {
const sut = (
<Text>
Expand Down

0 comments on commit e8401a1

Please sign in to comment.