Skip to content

Commit faed0c5

Browse files
#12342: JSTestDriver removal
- Fix timeout dropdown close.
1 parent 574daf5 commit faed0c5

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

dev/tests/js/jasmine/tests/lib/mage/dropdown.test.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ define([
243243
jasmine.clock().uninstall();
244244
});
245245

246-
it('check if the dialog gets closed with the specified delay', function () {
246+
it('check if the dialog gets closed with the specified delay', function (done) {
247247
var container = $('<div/>'),
248248
dialog = $('<div/>').attr('id', 'dialog').appendTo(container);
249249

@@ -252,8 +252,6 @@ define([
252252

253253
container.appendTo('body');
254254

255-
jasmine.clock().install();
256-
257255
dialog.dropdownDialog({
258256
'timeout': 5
259257
});
@@ -263,11 +261,11 @@ define([
263261
dialog.trigger('mouseleave');
264262
expect(dialog.dropdownDialog('isOpen')).toBeTruthy();
265263

266-
jasmine.clock().tick(10);
267-
expect(dialog.dropdownDialog('isOpen')).toBeFalsy();
268-
dialog.dropdownDialog('destroy');
269-
270-
jasmine.clock().uninstall();
264+
setTimeout(function () {
265+
expect(dialog.dropdownDialog('isOpen')).toBeFalsy();
266+
dialog.dropdownDialog('destroy');
267+
done();
268+
}, 6);
271269
});
272270

273271
/*

0 commit comments

Comments
 (0)