Add missing window.close to tests