From 5d5e47bc5aa15e8f499bd35b033ec297dabda48b Mon Sep 17 00:00:00 2001 From: Minjie Shen Date: Thu, 6 Dec 2018 10:59:44 +1100 Subject: [PATCH] Add test for window attribute --- types/netease-captcha/netease-captcha-tests.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/types/netease-captcha/netease-captcha-tests.ts b/types/netease-captcha/netease-captcha-tests.ts index c174affdf0..ee73302cc1 100644 --- a/types/netease-captcha/netease-captcha-tests.ts +++ b/types/netease-captcha/netease-captcha-tests.ts @@ -13,8 +13,11 @@ const config: NeteaseCaptcha.Config = { const onLoad: NeteaseCaptcha.onLoad = (instance: NeteaseCaptcha.Instance) => { instance.refresh(); instance.destroy(); + if (instance.popUp) { + instance.popUp(); + } }; -function init(initNECaptcha: NeteaseCaptcha.InitFunction): void { - initNECaptcha(config, onLoad); +if (window.initNECaptcha) { + window.initNECaptcha(config, onLoad); }