fix(delegate): find delegate when multiple parent histories

This commit is contained in:
Adam Bradley
2014-11-25 09:37:58 -06:00
parent 4f8bbc181f
commit 61916c61bb
2 changed files with 23 additions and 9 deletions

View File

@@ -1161,6 +1161,25 @@ describe('Ionic History', function() {
expect(ionicHistory.isActiveScope(scope)).toEqual(true);
});
it('should be active when one of the parent scopes is the same history id as current view', function() {
ionicHistory.currentView({
historyId: '123'
});
var scope = {
$parent: {
$historyId: 'abc',
$parent: {
$historyId: 'xyz',
$parent: {
$historyId: '123'
}
}
}
}
expect(ionicHistory.isActiveScope(scope)).toEqual(true);
});
it('should be not active w/ scope different history id as current view', function() {
ionicHistory.currentView({
historyId: '123'