Skip to content

Commit

Permalink
Adding a last message id for selenium testing (#5840)
Browse files Browse the repository at this point in the history
  • Loading branch information
coreyhulen authored and grundleborg committed Mar 23, 2017
1 parent 7d449e0 commit 37c41a2
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 3 deletions.
2 changes: 2 additions & 0 deletions webapp/components/post_view/components/post.jsx
Expand Up @@ -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}
Expand All @@ -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,
Expand Down
6 changes: 5 additions & 1 deletion webapp/components/post_view/components/post_body.jsx
Expand Up @@ -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>
);

Expand Down Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions webapp/components/post_view/components/post_list.jsx
Expand Up @@ -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}
Expand Down
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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}
Expand Down
4 changes: 3 additions & 1 deletion webapp/components/post_view/components/post_message_view.jsx
Expand Up @@ -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) {
Expand Down Expand Up @@ -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)}}
Expand Down

0 comments on commit 37c41a2

Please sign in to comment.