* fix #3791 and refactor isTestCall * typo * remove default value * add safe check if parent exists * add spec * better comment