Add tests for pre/post hooks