Skip to content

Commit

Permalink
fix(FeedSummary): add missing space around content (#3836)
Browse files Browse the repository at this point in the history
* missing space

* wrap feed summary content shorthand in whitespace

* test feed summary content whitespace
  • Loading branch information
ridvankaradag authored and levithomason committed Dec 8, 2019
1 parent 32df9e8 commit 55386d6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/views/Feed/FeedSummary.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,13 @@ function FeedSummary(props) {
return (
<ElementType {...rest} className={classes}>
{createShorthand(FeedUser, (val) => ({ content: val }), user, { autoGenerateKey: false })}
{/*
Content styles require wrapping whitespace
https://github.com/Semantic-Org/Semantic-UI-React/pull/3836
*/}
{content && ' '}
{content}
{content && ' '}
{createShorthand(FeedDate, (val) => ({ content: val }), date, { autoGenerateKey: false })}
</ElementType>
)
Expand Down
7 changes: 7 additions & 0 deletions test/specs/views/Feed/FeedSummary-test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import React from 'react'
import FeedSummary from 'src/views/Feed/FeedSummary'
import FeedDate from 'src/views/Feed/FeedDate'
import FeedUser from 'src/views/Feed/FeedUser'
Expand All @@ -19,4 +20,10 @@ describe('FeedSummary', () => {
ShorthandComponent: FeedUser,
mapValueToProps: (val) => ({ content: val }),
})

describe('content', () => {
it('inserts whitespace on both sides of the content', () => {
shallow(<FeedSummary content='test' />).should.contain.text(' test ')
})
})
})

0 comments on commit 55386d6

Please sign in to comment.