mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
fix(delegate): isActiveScope climb parent scopes
This commit is contained in:
@@ -1121,6 +1121,17 @@ describe('Ionic History', function() {
|
||||
expect(ionicHistory.isActiveScope(scope)).toEqual(false);
|
||||
});
|
||||
|
||||
it('should not be active when parent scope is disconnected', function() {
|
||||
var scope = {
|
||||
$parent: {
|
||||
$parent: {
|
||||
$$disconnected: true
|
||||
}
|
||||
}
|
||||
};
|
||||
expect(ionicHistory.isActiveScope(scope)).toEqual(false);
|
||||
});
|
||||
|
||||
it('should be active w/ scope but no current history id', function() {
|
||||
ionicHistory.registerHistory('1234');
|
||||
expect(ionicHistory.isActiveScope(scope)).toEqual(true);
|
||||
@@ -1137,6 +1148,19 @@ describe('Ionic History', function() {
|
||||
expect(ionicHistory.isActiveScope(scope)).toEqual(true);
|
||||
});
|
||||
|
||||
it('should be active w/ scopes parent the same history id as current view', function() {
|
||||
ionicHistory.currentView({
|
||||
historyId: '123'
|
||||
});
|
||||
|
||||
var scope = {
|
||||
$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'
|
||||
|
||||
Reference in New Issue
Block a user