write watch function test for $watch