diff --git a/dev/tests/js/jasmine/tests/lib/mage/accordion.test.js b/dev/tests/js/jasmine/tests/lib/mage/accordion.test.js index 12ca91a4ae002..19a54d95cf704 100644 --- a/dev/tests/js/jasmine/tests/lib/mage/accordion.test.js +++ b/dev/tests/js/jasmine/tests/lib/mage/accordion.test.js @@ -10,7 +10,7 @@ define([ describe('Test for mage/accordion jQuery plugin', function () { it('check if accordion can be initialized', function () { - var accordion = $("
"); + var accordion = $('
'); accordion.accordion(); expect(accordion.is(':mage-accordion')).toBeTruthy(); @@ -50,12 +50,11 @@ define([ }); it('check multi-collapsible element accordion', function () { var accordion = $('
'), + title1 = $('
').appendTo(accordion), content1 = $('
').appendTo(accordion), title2 = $('
').appendTo(accordion), content2 = $('
').appendTo(accordion); - $('
').appendTo(accordion); - accordion.appendTo('body'); accordion.accordion({ @@ -63,17 +62,18 @@ define([ }); expect(accordion.is(':mage-accordion')).toBeTruthy(); - expect(content1.is(':visible')).toBeTruthy(); expect(content2.is(':hidden')).toBeTruthy(); - title2.trigger('click'); + $(title1).trigger('click'); + expect(content1.is(':visible')).toBeTruthy(); + expect(content2.is(':hidden')).toBeTruthy(); + $(title2).trigger('click'); expect(content1.is(':visible')).toBeTruthy(); expect(content2.is(':visible')).toBeTruthy(); accordion.accordion('destroy'); - expect(accordion.is(':mage-accordion')).toBeFalsy(); }); });