mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-27 09:35:56 -05:00
Show the blue box on replies that got the user muted.
This commit is contained in:
parent
9a3fe8f222
commit
de5a8026c1
2 changed files with 22 additions and 1 deletions
|
@ -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>
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue