diff options
author | Corey Hulen <corey@hulen.com> | 2017-03-23 12:11:15 -0700 |
---|---|---|
committer | George Goldberg <george@gberg.me> | 2017-03-23 19:11:15 +0000 |
commit | 37c41a26c97e0a2fda80998fbb3594fa03b6b6dc (patch) | |
tree | ed8ab850d10e1334e432b9680625a4188b03f7fd /webapp | |
parent | 7d449e05562c76bb430efc1c36bd715675a84152 (diff) | |
download | chat-37c41a26c97e0a2fda80998fbb3594fa03b6b6dc.tar.gz chat-37c41a26c97e0a2fda80998fbb3594fa03b6b6dc.tar.bz2 chat-37c41a26c97e0a2fda80998fbb3594fa03b6b6dc.zip |
Adding a last message id for selenium testing (#5840)
Diffstat (limited to 'webapp')
5 files changed, 14 insertions, 3 deletions
diff --git a/webapp/components/post_view/components/post.jsx b/webapp/components/post_view/components/post.jsx index fba4ce9eb..645724467 100644 --- a/webapp/components/post_view/components/post.jsx +++ b/webapp/components/post_view/components/post.jsx @@ -283,6 +283,7 @@ export default class Post extends React.Component { post={post} currentUser={this.props.currentUser} sameRoot={this.props.sameRoot} + isLastPost={this.props.isLastPost} parentPost={parentPost} handleCommentClick={this.handleCommentClick} compactDisplay={this.props.compactDisplay} @@ -305,6 +306,7 @@ Post.propTypes = { sameUser: React.PropTypes.bool, sameRoot: React.PropTypes.bool, hideProfilePic: React.PropTypes.bool, + isLastPost: React.PropTypes.bool, isLastComment: React.PropTypes.bool, shouldHighlight: React.PropTypes.bool, displayNameType: React.PropTypes.string, diff --git a/webapp/components/post_view/components/post_body.jsx b/webapp/components/post_view/components/post_body.jsx index 8b650423f..eb1159987 100644 --- a/webapp/components/post_view/components/post_body.jsx +++ b/webapp/components/post_view/components/post_body.jsx @@ -163,7 +163,10 @@ export default class PostBody extends React.Component { className={postClass} > {loading} - <PostMessageContainer post={this.props.post}/> + <PostMessageContainer + isLastPost={this.props.isLastPost} + post={this.props.post} + /> </div> ); @@ -208,6 +211,7 @@ PostBody.propTypes = { currentUser: React.PropTypes.object.isRequired, parentPost: React.PropTypes.object, retryPost: React.PropTypes.func, + isLastPost: React.PropTypes.bool, handleCommentClick: React.PropTypes.func.isRequired, compactDisplay: React.PropTypes.bool, previewCollapsed: React.PropTypes.string, diff --git a/webapp/components/post_view/components/post_list.jsx b/webapp/components/post_view/components/post_list.jsx index d95d68120..10dad8a72 100644 --- a/webapp/components/post_view/components/post_list.jsx +++ b/webapp/components/post_view/components/post_list.jsx @@ -331,6 +331,7 @@ export default class PostList extends React.Component { <Post key={keyPrefix + 'postKey'} ref={post.id} + isLastPost={i === 0} sameUser={sameUser} sameRoot={sameRoot} post={post} diff --git a/webapp/components/post_view/components/post_message_container.jsx b/webapp/components/post_view/components/post_message_container.jsx index 4e27cd29a..676aa010e 100644 --- a/webapp/components/post_view/components/post_message_container.jsx +++ b/webapp/components/post_view/components/post_message_container.jsx @@ -15,7 +15,8 @@ import PostMessageView from './post_message_view.jsx'; export default class PostMessageContainer extends React.Component { static propTypes = { post: React.PropTypes.object.isRequired, - options: React.PropTypes.object + options: React.PropTypes.object, + isLastPost: React.PropTypes.bool }; static defaultProps = { @@ -90,6 +91,7 @@ export default class PostMessageContainer extends React.Component { <PostMessageView options={this.props.options} post={this.props.post} + isLastPost={this.props.isLastPost} emojis={this.state.emojis} enableFormatting={this.state.enableFormatting} mentionKeys={this.state.mentionKeys} diff --git a/webapp/components/post_view/components/post_message_view.jsx b/webapp/components/post_view/components/post_message_view.jsx index d097dbe5e..7f9789488 100644 --- a/webapp/components/post_view/components/post_message_view.jsx +++ b/webapp/components/post_view/components/post_message_view.jsx @@ -21,7 +21,8 @@ export default class PostMessageView extends React.Component { mentionKeys: React.PropTypes.arrayOf(React.PropTypes.string).isRequired, usernameMap: React.PropTypes.object.isRequired, channelNamesMap: React.PropTypes.object.isRequired, - team: React.PropTypes.object.isRequired + team: React.PropTypes.object.isRequired, + isLastPost: React.PropTypes.bool }; shouldComponentUpdate(nextProps) { @@ -113,6 +114,7 @@ export default class PostMessageView extends React.Component { return ( <div> <span + id={this.props.isLastPost ? 'lastPostMessageText' : null} className='post-message__text' onClick={Utils.handleFormattedTextClick} dangerouslySetInnerHTML={{__html: TextFormatting.formatText(this.props.post.message, options)}} |