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 20, 2016
1 parent 5fc78cf commit 7c0dd1c
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 @@ -542,6 +542,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 7c0dd1c

Please sign in to comment.