|
|
@ -45,6 +45,21 @@ describe('computeHashtagBarForStatus', () => {
|
|
|
|
);
|
|
|
|
);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it('does not truncate the contents when the last child is a text node', () => {
|
|
|
|
|
|
|
|
const status = createStatus(
|
|
|
|
|
|
|
|
'this is a #<a class="zrl" href="https://example.com/search?tag=test">test</a>. Some more text',
|
|
|
|
|
|
|
|
['test'],
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const { hashtagsInBar, statusContentProps } =
|
|
|
|
|
|
|
|
computeHashtagBarForStatus(status);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
expect(hashtagsInBar).toEqual([]);
|
|
|
|
|
|
|
|
expect(statusContentProps.statusContent).toMatchInlineSnapshot(
|
|
|
|
|
|
|
|
`"this is a #<a class="zrl" href="https://example.com/search?tag=test">test</a>. Some more text"`,
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
it('extract tags from the last line', () => {
|
|
|
|
it('extract tags from the last line', () => {
|
|
|
|
const status = createStatus(
|
|
|
|
const status = createStatus(
|
|
|
|
'<p>Simple text</p><p><a href="test">#hashtag</a></p>',
|
|
|
|
'<p>Simple text</p><p><a href="test">#hashtag</a></p>',
|
|
|
|