Pregunta de entrevista de Toptal

How would I unit test this component?