diff --git a/app/components/post_body/post_body.test.js b/app/components/post_body/post_body.test.js
index c040209cb..aa78520cb 100644
--- a/app/components/post_body/post_body.test.js
+++ b/app/components/post_body/post_body.test.js
@@ -67,4 +67,60 @@ describe('PostBody', () => {
expect(wrapper.find(PostBodyAdditionalContent).exists()).toBeFalsy();
});
+
+ test('measurePost should update isLongPost when showLongPost is false', () => {
+ const event = {
+ nativeEvent: {
+ layout: {
+ height: null,
+ },
+ },
+ };
+
+ const props = {...baseProps, showLongPost: false};
+ const wrapper = shallowWithIntl();
+ const instance = wrapper.instance();
+
+ expect(wrapper.state('isLongPost')).toEqual(false);
+
+ event.nativeEvent.layout.height = wrapper.state('maxHeight');
+ instance.measurePost(event);
+ expect(wrapper.state('isLongPost')).toEqual(true);
+
+ event.nativeEvent.layout.height = wrapper.state('maxHeight') - 1;
+ instance.measurePost(event);
+ expect(wrapper.state('isLongPost')).toEqual(false);
+
+ event.nativeEvent.layout.height = wrapper.state('maxHeight') + 1;
+ instance.measurePost(event);
+ expect(wrapper.state('isLongPost')).toEqual(true);
+ });
+
+ test('measurePost should not update isLongPost when showLongPost is true', () => {
+ const event = {
+ nativeEvent: {
+ layout: {
+ height: null,
+ },
+ },
+ };
+
+ const props = {...baseProps, showLongPost: true};
+ const wrapper = shallowWithIntl();
+ const instance = wrapper.instance();
+
+ expect(wrapper.state('isLongPost')).toEqual(false);
+
+ event.nativeEvent.layout.height = wrapper.state('maxHeight');
+ instance.measurePost(event);
+ expect(wrapper.state('isLongPost')).toEqual(false);
+
+ event.nativeEvent.layout.height = wrapper.state('maxHeight') - 1;
+ instance.measurePost(event);
+ expect(wrapper.state('isLongPost')).toEqual(false);
+
+ event.nativeEvent.layout.height = wrapper.state('maxHeight') + 1;
+ instance.measurePost(event);
+ expect(wrapper.state('isLongPost')).toEqual(false);
+ });
});