Add regression test for before/after feature