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.

(cherry picked from commit 179e9374b4)
This commit is contained in:
N-Shar-ma 2024-01-12 20:20:49 +05:30 committed by Tim Abbott
parent c4d567c792
commit dfb4fc4261
1 changed files with 391 additions and 681 deletions

File diff suppressed because it is too large Load Diff