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