Adding more test cases
Adding tests for onBefore