Cover button.setState function with tests