fix (content): #378 No heading without activity
This commit is contained in:
Родитель
8a8f452cbc
Коммит
3e94212095
|
@ -155,7 +155,7 @@ const GroupedActivityFeed = React.createClass({
|
|||
});
|
||||
const groupedSites = groupSitesByDate(sites);
|
||||
return (<div className="grouped-activity-feed">
|
||||
{this.props.title &&
|
||||
{sites.length > 0 && this.props.title &&
|
||||
<h3 className="section-title">{this.props.title}</h3>
|
||||
}
|
||||
{Array.from(groupedSites.keys()).map(date => {
|
||||
|
|
|
@ -127,6 +127,10 @@ describe("GroupedActivityFeed", function() {
|
|||
// ActivityFeed per site.
|
||||
assert.equal(children.length, fakeSites.length);
|
||||
});
|
||||
it("shouldn't render title if there are no sites", () => {
|
||||
const item = TestUtils.renderIntoDocument(<GroupedActivityFeed sites={[]} title="Fake Title" />);
|
||||
assert.isNull(ReactDOM.findDOMNode(item).querySelector(".section-title"));
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче