You have 3 methods. I'll give a short bit of advice to get you started.
Pull renderText out of handleWord and handleText. Instead make those two methods return the info you need and do the render somewhere else. Then you can unit test.
Next, consider making your anonymous function that pulls input text an actual function that extracts text. You can test that against various input then.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Heya Abel, let me offer a bit of advice here.
You have 3 methods. I'll give a short bit of advice to get you started.
Pull renderText out of handleWord and handleText. Instead make those two methods return the info you need and do the render somewhere else. Then you can unit test.
Next, consider making your anonymous function that pulls input text an actual function that extracts text. You can test that against various input then.