Skip to content

Commit

Permalink
Add a unit test to verify that the class is added to the panel.
Browse files Browse the repository at this point in the history
  • Loading branch information
crisbeto committed Dec 13, 2016
1 parent 378082b commit c597771
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/lib/select/select.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {TestBed, async, ComponentFixture} from '@angular/core/testing';
import {TestBed, async, ComponentFixture, fakeAsync, tick} from '@angular/core/testing';
import {By} from '@angular/platform-browser';
import {Component, DebugElement, QueryList, ViewChild, ViewChildren} from '@angular/core';
import {MdSelectModule} from './index';
Expand Down Expand Up @@ -497,6 +497,20 @@ describe('MdSelect', () => {
expect(fixture.componentInstance.select._placeholderState).toEqual('floating-rtl');
});


it('should add a class to the panel when the menu is done animating', fakeAsync(() => {
trigger.click();
fixture.detectChanges();

const panel = overlayContainerElement.querySelector('.md-select-panel');

expect(panel.classList).not.toContain('md-select-panel-done-animating');

tick(250);
fixture.detectChanges();

expect(panel.classList).toContain('md-select-panel-done-animating');
}));
});

describe('positioning', () => {
Expand Down

0 comments on commit c597771

Please sign in to comment.