Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

test(toolbar): Fix failing unit tests in 1.3.x. #6550

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/components/toolbar/toolbar.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ describe('<md-toolbar>', function() {
expect(element.find('md-toolbar').length).toBe(0);
}));

it('works with ng-show', inject(function($$rAF) {
it('works with ng-show', inject(function($$rAF, $timeout) {
var template =
'<div layout="column" style="height: 600px;">' +
' <md-toolbar md-scroll-shrink="true" ng-show="shouldShowToolbar">test</md-toolbar>' +
Expand Down Expand Up @@ -154,6 +154,7 @@ describe('<md-toolbar>', function() {
// Show the toolbar and ensure it is visible
pageScope.$apply('shouldShowToolbar = true');
pageScope.$digest();
$timeout.flush();

toolbarStyles = getComputedStyle(element.find('md-toolbar')[0]);
contentStyles = getComputedStyle(element.find('md-content')[0]);
Expand All @@ -170,7 +171,7 @@ describe('<md-toolbar>', function() {
document.body.removeChild(element[0]);
}));

it('works with ng-hide', inject(function($$rAF) {
it('works with ng-hide', inject(function($$rAF, $timeout) {
var template =
'<div layout="column" style="height: 600px;">' +
' <md-toolbar md-scroll-shrink="true" ng-hide="shouldNotShowToolbar">test</md-toolbar>' +
Expand Down Expand Up @@ -206,6 +207,7 @@ describe('<md-toolbar>', function() {
// Show the toolbar and ensure it is hidden
pageScope.$apply('shouldNotShowToolbar = true');
pageScope.$digest();
$timeout.flush();

toolbarStyles = getComputedStyle(element.find('md-toolbar')[0]);
contentStyles = getComputedStyle(element.find('md-content')[0]);
Expand Down