Skip to content

Commit

Permalink
fix(accordion): add 'accordion' css class
Browse files Browse the repository at this point in the history
Closes #2304
  • Loading branch information
maxokorokov authored and pkozlowski-opensource committed Apr 12, 2018
1 parent 9de58e6 commit d014d0e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/accordion/accordion.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {TestBed, ComponentFixture, inject} from '@angular/core/testing';
import {By} from '@angular/platform-browser';
import {createGenericTestComponent} from '../test/common';

import {Component} from '@angular/core';
Expand Down Expand Up @@ -73,6 +74,12 @@ describe('ngb-accordion', () => {
expect(accordionEl.getAttribute('aria-multiselectable')).toBe('true');
});

it('should have proper css classes', () => {
const fixture = TestBed.createComponent(TestComponent);
const accordion = fixture.debugElement.query(By.directive(NgbAccordion));
expect(accordion.nativeElement).toHaveCssClass('accordion');
});

it('should toggle panels based on "activeIds" values', () => {
const fixture = TestBed.createComponent(TestComponent);
const tc = fixture.componentInstance;
Expand Down
2 changes: 1 addition & 1 deletion src/accordion/accordion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export interface NgbPanelChangeEvent {
@Component({
selector: 'ngb-accordion',
exportAs: 'ngbAccordion',
host: {'role': 'tablist', '[attr.aria-multiselectable]': '!closeOtherPanels'},
host: {'class': 'accordion', 'role': 'tablist', '[attr.aria-multiselectable]': '!closeOtherPanels'},
template: `
<ng-template ngFor let-panel [ngForOf]="panels">
<div class="card">
Expand Down

0 comments on commit d014d0e

Please sign in to comment.