revised user.test.js + added User lifecycle hook