From 7bd8e81342c521b884b36f006163c73b20daa173 Mon Sep 17 00:00:00 2001
From: Kevin Jahns <kevin.jahns@rwth-aachen.de>
Date: Sun, 28 Aug 2016 22:13:07 +0200
Subject: [PATCH] fix test verifier

---
 src/SpecHelper.js | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/SpecHelper.js b/src/SpecHelper.js
index 7f590843..8eab4935 100644
--- a/src/SpecHelper.js
+++ b/src/SpecHelper.js
@@ -121,6 +121,10 @@ function * applyTransactions (relAmount, numberOfTransactions, objects, users, t
       // There will be an artificial delay until ops can be executed by the type,
       // therefore, operations of the database will be (pre)transformed until user operations arrive
       yield (function simulateConcurrentUserInteractions (type) {
+        if (!(type instanceof Y.utils.CustomType) && type.y instanceof Y.utils.CustomType) {
+          // usually we expect type to be a custom type. But in YXml we share an object {y: YXml, dom: Dom} instead 
+          type = type.y
+        }
         if (type.eventHandler.awaiting === 0 && type.eventHandler._debuggingAwaiting !== true) {
           type.eventHandler.awaiting = 1
           type.eventHandler._debuggingAwaiting = true
@@ -156,6 +160,10 @@ function * applyTransactions (relAmount, numberOfTransactions, objects, users, t
 }
 
 function fixAwaitingInType (type) {
+  if (!(type instanceof Y.utils.CustomType) && type.y instanceof Y.utils.CustomType) {
+    // usually we expect type to be a custom type. But in YXml we share an object {y: YXml, dom: Dom} instead 
+    type = type.y
+  }
   return new Promise(function (resolve) {
     type.os.whenTransactionsFinished().then(function () {
       // _debuggingAwaiting artificially increases the awaiting property. We need to make sure that we only do that once / reverse the effect once
-- 
GitLab