Skip to content

Commit

Permalink
Eslint improvements and logical fixes for unit testing.
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlos Lizaga committed Nov 22, 2017
1 parent 2846c78 commit f4712cd
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions dev/tests/js/jasmine/tests/lib/mage/accordion.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ define([

describe('Test for mage/accordion jQuery plugin', function () {
it('check if accordion can be initialized', function () {
var accordion = $("<div/>");
var accordion = $('<div/>');

accordion.accordion();
expect(accordion.is(':mage-accordion')).toBeTruthy();
Expand Down Expand Up @@ -50,30 +50,30 @@ define([
});
it('check multi-collapsible element accordion', function () {
var accordion = $('<div/>'),
title1 = $('<div data-role="collapsible"></div>').appendTo(accordion),
content1 = $('<div data-role="content"></div>').appendTo(accordion),
title2 = $('<div data-role="collapsible"></div>').appendTo(accordion),
content2 = $('<div data-role="content"></div>').appendTo(accordion);

$('<div data-role="collapsible"></div>').appendTo(accordion);

accordion.appendTo('body');

accordion.accordion({
multipleCollapsible: true
});

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();
});
});
Expand Down

0 comments on commit f4712cd

Please sign in to comment.