Refactor component test