diff --git a/app/components/post_header/__snapshots__/post_header.test.js.snap b/app/components/post_header/__snapshots__/post_header.test.js.snap index 1ae92ee78..2cdfe3e0c 100644 --- a/app/components/post_header/__snapshots__/post_header.test.js.snap +++ b/app/components/post_header/__snapshots__/post_header.test.js.snap @@ -31,6 +31,80 @@ exports[`PostHeader should match snapshot when just a base post 1`] = ` "maxWidth": "60%", }, null, + null, + ] + } + type="opacity" + > + + John Smith + + + + + + +`; + +exports[`PostHeader should match snapshot when just a base post in landscape mode 1`] = ` + + + + @@ -275,6 +350,7 @@ exports[`PostHeader should match snapshot when post is same thread, so dont disp "maxWidth": "60%", }, null, + null, ] } type="opacity" @@ -364,6 +440,162 @@ exports[`PostHeader should match snapshot when post isBot and shouldRenderReplyB Object { "maxWidth": "50%", }, + null, + ] + } + type="opacity" + > + + John Smith + + + + + + + + + 0 + + + + + + +`; + +exports[`PostHeader should match snapshot when post isBot and shouldRenderReplyButton in landscape mode 1`] = ` + + + + 0 && renderReplies); - const displayNameStyle = [style.displayNameContainer, showReply && (isBot || fromAutoResponder || fromWebHook) ? style.displayNameContainerBotReplyWidth : null]; + const reduceWidth = showReply && (isBot || fromAutoResponder || fromWebHook); + const isLandscapeStyle = isLandscape && reduceWidth ? style.displayNameContainerLandscapeBotReplyWidth : isLandscape ? style.displayNameContainerLandscape : null; //eslint-disable-line no-nested-ternary + const displayNameStyle = [style.displayNameContainer, reduceWidth ? style.displayNameContainerBotReplyWidth : null, isLandscapeStyle]; if (fromAutoResponder || fromWebHook) { let name = displayName; @@ -367,5 +371,11 @@ const getStyleSheet = makeStyleSheetFromTheme((theme) => { displayNameContainerBotReplyWidth: { maxWidth: '50%', }, + displayNameContainerLandscape: { + maxWidth: '80%', + }, + displayNameContainerLandscapeBotReplyWidth: { + maxWidth: '70%', + }, }; }); diff --git a/app/components/post_header/post_header.test.js b/app/components/post_header/post_header.test.js index bfd9f4fde..6cff0863d 100644 --- a/app/components/post_header/post_header.test.js +++ b/app/components/post_header/post_header.test.js @@ -29,6 +29,7 @@ describe('PostHeader', () => { username: 'JohnSmith', isBot: false, isGuest: false, + isLandscape: false, userTimezone: '', enableTimezone: false, previousPostExists: false, @@ -126,4 +127,31 @@ describe('PostHeader', () => { ); expect(wrapper.getElement()).toMatchSnapshot(); }); + + test('should match snapshot when just a base post in landscape mode', () => { + const props = { + ...baseProps, + isLandscape: true, + }; + + const wrapper = shallow( + + ); + expect(wrapper.getElement()).toMatchSnapshot(); + expect(wrapper.find('#ReplyIcon').exists()).toEqual(false); + }); + + test('should match snapshot when post isBot and shouldRenderReplyButton in landscape mode', () => { + const props = { + ...baseProps, + shouldRenderReplyButton: true, + isBot: true, + isLandscape: true, + }; + + const wrapper = shallow( + + ); + expect(wrapper.getElement()).toMatchSnapshot(); + }); }); \ No newline at end of file