mirror of https://github.com/zulip/zulip.git
compose: Revamp and improve test suite for compose formatting buttons.
Earlier, the tests for compose formatting were verbose, hard to read as well as extend, and overly granular, without even having the ability to test the final text selection or the cursor position. Now, new test helpers, `init_textarea_state` and `get_textarea_state`, have been added, enabling the tests to be more concise and readable, while also being more powerful. A representative string alone now describes the textarea state (the text and the selection / cursor), making each test case as easy as defining the initial state as a string and comparing the expected state post formatting with another string. These new tests helped surface a couple bugs which have been fixed in preceding commits.
This commit is contained in:
parent
a5889bc3af
commit
179e9374b4