Skip to content

Commit 55386d6

Browse files
ridvankaradaglevithomason
authored andcommitted
fix(FeedSummary): add missing space around content (#3836)
* missing space * wrap feed summary content shorthand in whitespace * test feed summary content whitespace
1 parent 32df9e8 commit 55386d6

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

src/views/Feed/FeedSummary.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,13 @@ function FeedSummary(props) {
3333
return (
3434
<ElementType {...rest} className={classes}>
3535
{createShorthand(FeedUser, (val) => ({ content: val }), user, { autoGenerateKey: false })}
36+
{/*
37+
Content styles require wrapping whitespace
38+
https://github.com/Semantic-Org/Semantic-UI-React/pull/3836
39+
*/}
40+
{content && ' '}
3641
{content}
42+
{content && ' '}
3743
{createShorthand(FeedDate, (val) => ({ content: val }), date, { autoGenerateKey: false })}
3844
</ElementType>
3945
)

test/specs/views/Feed/FeedSummary-test.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import React from 'react'
12
import FeedSummary from 'src/views/Feed/FeedSummary'
23
import FeedDate from 'src/views/Feed/FeedDate'
34
import FeedUser from 'src/views/Feed/FeedUser'
@@ -19,4 +20,10 @@ describe('FeedSummary', () => {
1920
ShorthandComponent: FeedUser,
2021
mapValueToProps: (val) => ({ content: val }),
2122
})
23+
24+
describe('content', () => {
25+
it('inserts whitespace on both sides of the content', () => {
26+
shallow(<FeedSummary content='test' />).should.contain.text(' test ')
27+
})
28+
})
2229
})

0 commit comments

Comments
 (0)