-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
1 parent
846899d
commit a882546
Showing
5 changed files
with
180 additions
and
408 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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(); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.