Skip to content

Commit

Permalink
Add updateCreatorModel for knockout f tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dk981234 committed Oct 22, 2024
1 parent b39f1cc commit 581541a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/survey-creator-knockout/testCafe/testcafe.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
}
</script>
</body>

Expand Down

0 comments on commit 581541a

Please sign in to comment.