Ensure test-files only tests in current root directory

Ensute the hidden field test-files is cleared when the user switches
between different root directories