Using spy() to track the reactivity