Add test for apGrad