[Mobile] Tests

Changed BrowseController and RemoveActionSpec to account
for grandparent and navigation usage. Also changed
RemoveAction variable name.
This commit is contained in:
Shivam Dave 2015-07-29 13:57:11 -07:00
parent bdf8b4d3f1
commit 12ec293f3d
3 changed files with 9 additions and 4 deletions

View File

@ -301,7 +301,7 @@ define(
mockNavigationService
);
mockScope.checkRoot();
mockScope.checkRoot();
});
// Mocks the back arrow call that

View File

@ -70,8 +70,9 @@ define(
}
function checkCurrentObjectNavigation(parent) {
var currParent = navigationService.getNavigation().getCapability('context').getParent();
if (currParent.getId() === parent.getId()) {
var currentParent = navigationService.getNavigation()
.getCapability('context').getParent();
if (currentParent.getId() === parent.getId()) {
navigationService.setNavigation(parent);
}
}

View File

@ -65,6 +65,9 @@ define(
},
useCapability: function (k, v) {
return capabilities[k].invoke(v);
},
getId: function () {
return "test";
}
};
mockContext = jasmine.createSpyObj("context", [ "getParent" ]);
@ -80,13 +83,14 @@ define(
"removeListener"
]
);
mockNavigationService.getNavigation.andReturn(mockDomainObject);
mockDomainObject.getId.andReturn("test");
mockDomainObject.getCapability.andReturn(mockContext);
mockContext.getParent.andReturn(mockParent);
mockType.hasFeature.andReturn(true);
capabilities = {
mutation: mockMutation,
persistence: mockPersistence,