From 581541a2d7cda072e990e84cac44eb898a2eddd5 Mon Sep 17 00:00:00 2001 From: Dmitry Kuzin Date: Tue, 22 Oct 2024 20:55:11 +0400 Subject: [PATCH] Add updateCreatorModel for knockout f tests --- packages/survey-creator-knockout/testCafe/testcafe.html | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/survey-creator-knockout/testCafe/testcafe.html b/packages/survey-creator-knockout/testCafe/testcafe.html index c7e2ed76f4..d06cec4e05 100644 --- a/packages/survey-creator-knockout/testCafe/testcafe.html +++ b/packages/survey-creator-knockout/testCafe/testcafe.html @@ -29,6 +29,15 @@ const creator = new SurveyCreator.SurveyCreator({ showLogicTab: true, showTranslationTab: true }); window.creator = creator; ko.applyBindings({ creator: creator }); + window.updateCreatorModel = (options, json) => { + window.prevCreator = window.creator; + window.creator.dispose(); + ko.cleanNode(document.body); + const creator = new SurveyCreator.SurveyCreator(options); + creator.JSON = json; + window.creator = creator; + ko.applyBindings({ creator: creator }); + }