DEV Community

Discussion on: Advice for UI Testing

Collapse
 
recursivefaults profile image
Ryan Latta

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.