Show the blue box on replies that got the user muted.

This commit is contained in:
picklesrus 2021-02-05 08:16:00 -05:00
parent 9a3fe8f222
commit de5a8026c1
2 changed files with 22 additions and 1 deletions

View file

@ -240,7 +240,7 @@ class ComposeComment extends React.Component {
render () {
return (
<React.Fragment>
{(this.isMuted() && !this.props.isReply) ? (
{(this.isMuted() && !(this.props.isReply && this.state.status !== ComposeStatus.REJECTED_MUTE)) ? (
<FlexRow className="comment">
<CommentingStatus>
<p><FormattedMessage id={this.getMuteMessageInfo().commentType} /></p>

View file

@ -173,6 +173,27 @@ describe('Compose Comment test', () => {
global.Date.now = realDateNow;
});
test('Comment Status shows when user just submitted a reply comment that got them muted', () => {
const realDateNow = Date.now.bind(global.Date);
global.Date.now = () => 0;
const component = getComposeCommentWrapper({isReply: true});
const commentInstance = component.instance();
commentInstance.setState({
status: 'REJECTED_MUTE',
muteExpiresAtMs: 100
});
component.update();
expect(component.find('FlexRow.compose-comment').exists()).toEqual(true);
expect(component.find('MuteModal').exists()).toEqual(false);
expect(component.find('CommentingStatus').exists()).toEqual(true);
// Compose box exists but is disabled
expect(component.find('InplaceInput.compose-input').exists()).toEqual(true);
expect(component.find('InplaceInput.compose-input').props().disabled).toBe(true);
expect(component.find('Button.compose-post').props().disabled).toBe(true);
expect(component.find('Button.compose-cancel').props().disabled).toBe(true);
global.Date.now = realDateNow;
});
test('Comment Status shows when user just submitted a comment that got them muted', () => {
const realDateNow = Date.now.bind(global.Date);
global.Date.now = () => 0;