fix: handling rerender in sandbox mode fixing tests

This commit is contained in:
Knut Sveidqvist
2022-01-22 13:29:54 +01:00
parent e3e9c67f5b
commit eeccf1c56b
4 changed files with 22 additions and 59 deletions

View File

@@ -28,10 +28,13 @@ export const setConf = function (cnf) {
* @param svgId
* @param root
* @param doc
* @param _doc
*/
export const addVertices = function (vert, g, svgId, root, doc) {
export const addVertices = function (vert, g, svgId, root, _doc) {
const securityLevel = getConfig().securityLevel;
const svg = root.select(`[id="${svgId}"]`);
const svg = !root ? select(`[id="${svgId}"]`) : root.select(`[id="${svgId}"]`);
const doc = !_doc ? document : _doc;
const keys = Object.keys(vert);
// Iterate through each item in the vertex object (containing all the vertices found) in the graph definition

View File

@@ -564,7 +564,8 @@ export const draw = function (text, id) {
bounds.init();
log.debug(`C:${JSON.stringify(conf, null, 2)}`);
const diagram = root.select(`[id="${id}"]`);
const diagram =
securityLevel === 'sandbox' ? root.select(`[id="${id}"]`) : select(`[id="${id}"]`);
// Fetch data from the parsing
const actors = parser.yy.getActors();