fix(isActiveScope): find active scope

Find a slide box within a modal within the active tab within a side
menu, each history with cached views. Find the active scroll view with
multiple tabs. Find a slide box when the modal is attached to the tabs
controller.
This commit is contained in:
Adam Bradley
2014-12-08 01:08:19 -06:00
parent 37dd84c6de
commit 7b39bc442e
4 changed files with 70 additions and 3 deletions

View File

@@ -1195,7 +1195,43 @@ describe('Ionic History', function() {
}
}
}
}
};
expect(ionicHistory.isActiveScope(scope)).toEqual(true);
});
it('should be active when activeHistoryId found before historyId, for tabs controller', function() {
ionicHistory.currentView({
historyId: '123'
});
var scope = {
$parent: {
$parent: {
$activeHistoryId: '123',
$parent: {
$historyId: 'xyz'
}
}
}
};
expect(ionicHistory.isActiveScope(scope)).toEqual(true);
});
it('should be active when historyId found before activeHistoryId', function() {
ionicHistory.currentView({
historyId: '123'
});
var scope = {
$parent: {
$parent: {
$activeHistoryId: 'xyz',
$parent: {
$historyId: '123'
}
}
}
};
expect(ionicHistory.isActiveScope(scope)).toEqual(true);
});