Unverified Commit af78bbf5 authored by Mattermost Build's avatar Mattermost Build Committed by GitHub
Browse files

Automated cherry pick of #5908 (#5933)

Automatic Merge
parent 7a707a68
......@@ -22,6 +22,7 @@ exports[`components/PostMarkdown plugin hooks can build upon other hook message
options={
Object {
"disableGroupHighlight": false,
"mentionHighlight": true,
}
}
proxyImages={true}
......@@ -50,6 +51,7 @@ exports[`components/PostMarkdown plugin hooks can overwrite other hooks messages
options={
Object {
"disableGroupHighlight": false,
"mentionHighlight": true,
}
}
proxyImages={true}
......@@ -153,6 +155,7 @@ exports[`components/PostMarkdown should render properly with a post 1`] = `
options={
Object {
"disableGroupHighlight": false,
"mentionHighlight": true,
}
}
proxyImages={true}
......@@ -195,6 +198,7 @@ exports[`components/PostMarkdown should render properly without group highlight
options={
Object {
"disableGroupHighlight": true,
"mentionHighlight": true,
}
}
proxyImages={true}
......
......@@ -76,6 +76,10 @@ export default class PostMarkdown extends React.PureComponent {
}
});
if (post && post.props) {
options.mentionHighlight = !post.props.mentionHighlightDisabled;
}
return (
<Markdown
imageProps={this.props.imageProps}
......
......@@ -27,7 +27,7 @@ describe('Mention user', () => {
let testUser;
before(() => {
// # Login as test user and visit town-square
// # Login as admin and visit town-square
cy.apiInitSetup().then(({team, user}) => {
testUser = user;
......@@ -52,3 +52,33 @@ describe('Mention user', () => {
});
});
});
describe('Mention self', () => {
let testUser;
before(() => {
// # Login as test user and visit town-square
cy.apiInitSetup().then(({team, user}) => {
testUser = user;
cy.apiLogin(testUser);
cy.visit(`/${team.name}/channels/town-square`);
});
});
it('should be always highlighted', () => {
[
`@${testUser.username}`,
`@${testUser.username}.`,
`@${testUser.username}_`,
`@${testUser.username}-`,
`@${testUser.username},`,
].forEach((message) => {
cy.postMessage(message);
cy.getLastPostId().then((postId) => {
cy.get(`#postMessageText_${postId}`).find('.mention--highlight');
});
});
});
});
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment