mirror of
https://github.com/nasa/openmct.git
synced 2025-01-19 11:17:04 +00:00
[Mobile] Tests
Changed BrowseController and RemoveActionSpec to account for grandparent and navigation usage. Also changed RemoveAction variable name.
This commit is contained in:
parent
bdf8b4d3f1
commit
12ec293f3d
@ -301,7 +301,7 @@ define(
|
|||||||
mockNavigationService
|
mockNavigationService
|
||||||
);
|
);
|
||||||
|
|
||||||
mockScope.checkRoot();
|
mockScope.checkRoot();
|
||||||
});
|
});
|
||||||
|
|
||||||
// Mocks the back arrow call that
|
// Mocks the back arrow call that
|
||||||
|
@ -70,8 +70,9 @@ define(
|
|||||||
}
|
}
|
||||||
|
|
||||||
function checkCurrentObjectNavigation(parent) {
|
function checkCurrentObjectNavigation(parent) {
|
||||||
var currParent = navigationService.getNavigation().getCapability('context').getParent();
|
var currentParent = navigationService.getNavigation()
|
||||||
if (currParent.getId() === parent.getId()) {
|
.getCapability('context').getParent();
|
||||||
|
if (currentParent.getId() === parent.getId()) {
|
||||||
navigationService.setNavigation(parent);
|
navigationService.setNavigation(parent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -65,6 +65,9 @@ define(
|
|||||||
},
|
},
|
||||||
useCapability: function (k, v) {
|
useCapability: function (k, v) {
|
||||||
return capabilities[k].invoke(v);
|
return capabilities[k].invoke(v);
|
||||||
|
},
|
||||||
|
getId: function () {
|
||||||
|
return "test";
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
mockContext = jasmine.createSpyObj("context", [ "getParent" ]);
|
mockContext = jasmine.createSpyObj("context", [ "getParent" ]);
|
||||||
@ -80,13 +83,14 @@ define(
|
|||||||
"removeListener"
|
"removeListener"
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
mockNavigationService.getNavigation.andReturn(mockDomainObject);
|
||||||
|
|
||||||
|
|
||||||
mockDomainObject.getId.andReturn("test");
|
mockDomainObject.getId.andReturn("test");
|
||||||
mockDomainObject.getCapability.andReturn(mockContext);
|
mockDomainObject.getCapability.andReturn(mockContext);
|
||||||
mockContext.getParent.andReturn(mockParent);
|
mockContext.getParent.andReturn(mockParent);
|
||||||
mockType.hasFeature.andReturn(true);
|
mockType.hasFeature.andReturn(true);
|
||||||
|
|
||||||
|
|
||||||
capabilities = {
|
capabilities = {
|
||||||
mutation: mockMutation,
|
mutation: mockMutation,
|
||||||
persistence: mockPersistence,
|
persistence: mockPersistence,
|
||||||
|
Loading…
Reference in New Issue
Block a user