소스 검색

Wait until controlbox is connected when opening in test utils

JC Brand 6 년 전
부모
커밋
f7a689d702
1개의 변경된 파일4개의 추가작업 그리고 2개의 파일을 삭제
  1. 4 2
      tests/utils.js

+ 4 - 2
tests/utils.js

@@ -61,8 +61,10 @@
         return this;
     };
 
-    utils.openControlBox = function () {
-        const toggle = document.querySelector(".toggle-controlbox");
+    utils.openControlBox = async function (_converse) {
+        const model = await _converse.api.chats.open('controlbox');
+        await utils.waitUntil(() => model.get('connected'));
+        var toggle = document.querySelector(".toggle-controlbox");
         if (!u.isVisible(document.querySelector("#controlbox"))) {
             if (!u.isVisible(toggle)) {
                 u.removeClass('hidden', toggle);