mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
@@ -47,7 +47,9 @@ describe('$ionicSideMenus controller', function() {
|
||||
el: document.createElement('div'),
|
||||
isEnabled: true
|
||||
});
|
||||
ctrl.setContent(new Controller({ el: document.createElement('div') }));
|
||||
var content = new Controller({ el: document.createElement('div') });
|
||||
content.setMarginLeft = function(){};
|
||||
ctrl.setContent(content);
|
||||
});
|
||||
|
||||
});
|
||||
@@ -104,6 +106,34 @@ describe('$ionicSideMenus controller', function() {
|
||||
expect(ctrl.getOpenPercentage()).toEqual(0);
|
||||
});
|
||||
|
||||
it('should not toggle left with exposed aside', function() {
|
||||
expect(ctrl.getOpenPercentage()).toEqual(0);
|
||||
ctrl.exposeAside(true);
|
||||
ctrl.toggleLeft();
|
||||
expect(ctrl.getOpenPercentage()).toEqual(0);
|
||||
});
|
||||
|
||||
it('should not toggle right with exposed aside', function() {
|
||||
expect(ctrl.getOpenPercentage()).toEqual(0);
|
||||
ctrl.exposeAside(true);
|
||||
ctrl.toggleRight();
|
||||
expect(ctrl.getOpenPercentage()).toEqual(0);
|
||||
});
|
||||
|
||||
it('should close left menu on expose aside', function() {
|
||||
ctrl.toggleLeft();
|
||||
expect(ctrl.getOpenPercentage()).toEqual(100);
|
||||
ctrl.exposeAside(true);
|
||||
expect(ctrl.getOpenPercentage()).toEqual(0);
|
||||
});
|
||||
|
||||
it('should close right menu on expose aside', function() {
|
||||
ctrl.toggleRight();
|
||||
expect(ctrl.getOpenPercentage()).toEqual(-100);
|
||||
ctrl.exposeAside(true);
|
||||
expect(ctrl.getOpenPercentage()).toEqual(0);
|
||||
});
|
||||
|
||||
it('should toggle right', function() {
|
||||
ctrl.toggleRight();
|
||||
expect(ctrl.getOpenPercentage()).toEqual(-100);
|
||||
@@ -219,9 +249,6 @@ describe('$ionicSideMenus controller', function() {
|
||||
expect(ctrl.getOpenPercentage()).toEqual(-100);
|
||||
});
|
||||
|
||||
it('Should test content drag events', function() {
|
||||
});
|
||||
|
||||
it('should register with backButton on open and dereg on close', inject(function($ionicPlatform) {
|
||||
var openAmount = 0;
|
||||
var deregSpy = jasmine.createSpy('deregister');
|
||||
|
||||
Reference in New Issue
Block a user