Refactor testing when buttons should be enabled