quote-and-reply: Add tests for caret position.
quote-and-reply: Add tests for caret position.

This was rebased and significantly modified by @showell:
    * introduce vars for textarea_val and textarea_caret_pos
    * simplify mock_esm call
    * use override for hash_util
    * minor things like whitespace cleanup

(see #18849 for the original PR)

eeshangarg/zulip,hackerkid/zulip,rht/zulip,andersk/zulip,kou/zulip,kou/zulip,zulip/zulip,punchagan/zulip,rht/zulip,hackerkid/zulip,andersk/zulip,punchagan/zulip,eeshangarg/zulip,eeshangarg/zulip,hackerkid/zulip,eeshangarg/zulip,hackerkid/zulip,andersk/zulip,eeshangarg/zulip,rht/zulip,andersk/zulip,eeshangarg/zulip,hackerkid/zulip,andersk/zulip,andersk/zulip,punchagan/zulip,zulip/zulip,zulip/zulip,punchagan/zulip,kou/zulip,kou/zulip,rht/zulip,kou/zulip,hackerkid/zulip,zulip/zulip,andersk/zulip,zulip/zulip,rht/zulip,zulip/zulip,hackerkid/zulip,kou/zulip,zulip/zulip,rht/zulip,punchagan/zulip,punchagan/zulip,punchagan/zulip,eeshangarg/zulip,kou/zulip,rht/zulip