Adds test for beforeValidation hook