Toptal Interview Question

How would I unit test this component?