Add a test to check that callbacks are called properly