Extract test feature for closing detail on click outside into new file