react testing library spy on function