Put the test in the right place. Replace the body removal, that destroys jasmine things, with a known safe wrapper