Tests: move authentication helper to window scope