mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
refactor(sidenav): switch to the angular animations API (#4959)
* refactor(sidenav): switch to the angular animations API Switches the sidenav to use the `@angular/animations` API. This saves us a lot of code that was involved in orchestrating the various animations, in addition to making it easier to follow. It also makes it possible for the consumer to disable the animations by using the `NoopAnimationsModule`. * chore: remove redundant annotations * fix: focus restoration issue in IE * chore: linting error * chore: put back the toggle animation promises * fix: avoid initial animation * fix: sidenav not showing when animation starts * chore: update e2e tests
This commit is contained in:
committed by
tinayuangao
parent
846899db0e
commit
a882546deb
@@ -1,26 +1,27 @@
|
||||
import {browser, by, element, ExpectedConditions} from 'protractor';
|
||||
import {browser, by, element, ElementFinder} from 'protractor';
|
||||
|
||||
describe('sidenav', () => {
|
||||
describe('opening and closing', () => {
|
||||
beforeEach(() => browser.get('/sidenav'));
|
||||
|
||||
let input = element(by.tagName('md-sidenav'));
|
||||
let sidenav: ElementFinder;
|
||||
|
||||
beforeEach(() => {
|
||||
browser.get('/sidenav');
|
||||
sidenav = element(by.tagName('md-sidenav'));
|
||||
});
|
||||
|
||||
it('should be closed', () => {
|
||||
expect(input.isDisplayed()).toBeFalsy();
|
||||
expect(sidenav.isDisplayed()).toBeFalsy();
|
||||
});
|
||||
|
||||
it('should open', () => {
|
||||
element(by.buttonText('Open sidenav')).click();
|
||||
expect(input.isDisplayed()).toBeTruthy();
|
||||
expect(sidenav.isDisplayed()).toBeTruthy();
|
||||
});
|
||||
|
||||
it('should close again', () => {
|
||||
element(by.buttonText('Open sidenav')).click();
|
||||
element(by.buttonText('Open sidenav')).click();
|
||||
browser.wait(ExpectedConditions.presenceOf(element(by.className('mat-sidenav-closed'))), 999);
|
||||
expect(input.isDisplayed()).toBeFalsy();
|
||||
expect(sidenav.isDisplayed()).toBeFalsy();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user