mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
test(list): use timeout.flush()
This commit is contained in:
1
js/angular/controller/sideMenuController.js
vendored
1
js/angular/controller/sideMenuController.js
vendored
@@ -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) {
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user