mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
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:
@@ -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);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user