From efa51e495e788f01873fa3fefca98ceddb410055 Mon Sep 17 00:00:00 2001 From: Adam Gordon Date: Sat, 8 Aug 2015 10:08:53 -0600 Subject: [PATCH] fix(accordion): add `open` class when expanded - add `open` class to `.panel-collapse` when open. - fix missing closing `<` on test. fixes #3419 --- src/accordion/test/accordion.spec.js | 12 +++++++++++- template/accordion/accordion-group.html | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/accordion/test/accordion.spec.js b/src/accordion/test/accordion.spec.js index decedaf98b..26aeffc94f 100644 --- a/src/accordion/test/accordion.spec.js +++ b/src/accordion/test/accordion.spec.js @@ -114,7 +114,7 @@ describe('accordion', function () { it('should expose the controller on the view', function () { $templateCache.put('template/accordion/accordion.html', '
{{accordion.text}}
'); - element = $compile('')(scope); scope.$digest(); var ctrl = element.controller('accordion'); @@ -211,6 +211,16 @@ describe('accordion', function () { scope.$digest(); expect(findGroupBody(0).scope().isOpen).toBe(false); }); + + it('should add "open" when opened', function() { + findGroupLink(0).click(); + scope.$digest(); + expect(findGroupBody(0)).toHaveClass('open'); + + findGroupLink(0).click(); + scope.$digest(); + expect(findGroupBody(0)).not.toHaveClass('open'); + }); }); describe('with dynamic panels', function () { diff --git a/template/accordion/accordion-group.html b/template/accordion/accordion-group.html index 8ad810abe8..436f88bf72 100644 --- a/template/accordion/accordion-group.html +++ b/template/accordion/accordion-group.html @@ -4,7 +4,7 @@

{{heading}}

-
+