Toptal interview question

How would I unit test this component?