Skip to content

Commit fae4c5a

Browse files
committed
update unit tests
1 parent b46b5c7 commit fae4c5a

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/js/jquery.orgchart.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,10 @@
112112
if (mutations[i].addedNodes[j].classList.contains('orgchart')) {
113113
if (that.options.initCompleted && typeof that.options.initCompleted === 'function') {
114114
that.options.initCompleted(that.$chart);
115-
var initEvent = $.Event('init.orgchart');
116-
that.$chart.trigger(initEvent);
117-
break initTime;
118115
}
116+
var initEvent = $.Event('init.orgchart');
117+
that.$chart.trigger(initEvent);
118+
break initTime;
119119
}
120120
}
121121
}

test/unit/tests.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,10 +175,10 @@ describe('orgchart -- unit tests', function () {
175175
}
176176
};
177177
if (typeof MutationObserver !== 'undefined') {
178-
oc.init({ 'visibleLevel': 2, 'verticalLevel': 3 }).$chart.on('init.orgchart', check);
178+
oc.init({ 'visibleLevel': 2, 'verticalLevel': 3 }).$chart.one('init.orgchart', check);
179179
} else {
180180
oc.init({ 'visibleLevel': 2, 'verticalLevel': 3 });
181-
setTimeout(check, 500);
181+
setTimeout(check, 0);
182182
}
183183
});
184184

0 commit comments

Comments
 (0)