test(list): use timeout.flush()

This commit is contained in:
Andrew
2014-07-06 14:20:48 -06:00
parent ba56bb983f
commit 22a81fe82c
3 changed files with 3 additions and 2 deletions

View File

@@ -24,6 +24,7 @@ function($scope, $attrs, $ionicSideMenuDelegate, $ionicPlatform) {
};
this.dragThreshold = 25;
this.dragOnlyEdge = false;
this.edgeDragThreshold = function(value) {
if (arguments.length) {
if (angular.isNumber(value) && value > 0) {

View File

@@ -13,7 +13,7 @@
<ion-side-menus>
<ion-side-menu-content edge-drag-threshold="false">
<ion-side-menu-content edge-drag-threshold="true">
<header class="bar bar-header bar-positive">
<button class="button button-icon ion-navicon" ng-click="toggleLeft()"></button>
<h1 class="title">Slide me</h1>

View File

@@ -44,7 +44,7 @@ describe('ionList directive', function() {
el.scope().$onReorder = jasmine.createSpy('$onReorder');
options.onReorder(el, 2, 3);
expect(el.scope().$onReorder).not.toHaveBeenCalled();
el.scope().$apply();
flush();
expect(el.scope().$onReorder).toHaveBeenCalledWith(2,3);
});