AztecEditor-Android icon indicating copy to clipboard operation
AztecEditor-Android copied to clipboard

[Bug] Fix crash and add unit test to cover the issue.

Open notandyvee opened this issue 9 months ago • 1 comments

Fix

Fixes: https://github.com/wordpress-mobile/WordPress-Android/issues/20738

Fix a crash that occurs when a gutenberg post is being edited and there is a block with text color on it, it's possible for the color to be malformed or not parselable. The reasoning for how the Color is empty is not clear, but the function is clear that an empty string is possible. Added unit test to also confirm this covers both an empty and null string color.

Test

  1. Run the test project and ensure you see no crash.
  2. Ensure MarkSpanTest passes.

Review

@thomashorta or @antonis

Make sure strings will be translated:

  • [x] If there are new strings that have to be translated, I have added them to the client's strings.xml as a part of the integration PR.

notandyvee avatar May 01 '24 21:05 notandyvee

@thomashorta ready for re-review 🙏🏻

notandyvee avatar May 03 '24 22:05 notandyvee

@thomashorta I responded to your bigger point. But I made slightly bigger changes in response. As it turns out, I didn't even need to mock anything 🤦🏻 . Since we really only care about the crashes, this makes the most sense. Appreciate you elaborating as it helped me noticed an oversight I made.

notandyvee avatar May 06 '24 16:05 notandyvee