mirror of
https://github.com/nasa/openmct.git
synced 2025-01-19 11:17:04 +00:00
[Addressability} Unit Test
Completed unit tests to accomodate for url path check prior to setting the current . WTD 23.
This commit is contained in:
parent
3de4473159
commit
2e716bdbe3
@ -222,15 +222,20 @@ define(
|
|||||||
mockNavigationService.addListener.mostRecentCall.args[0](
|
mockNavigationService.addListener.mostRecentCall.args[0](
|
||||||
mockNextObject
|
mockNextObject
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Allows the path index to be checked
|
||||||
|
// prior to setting $route.current
|
||||||
|
mockLocation.path.andReturn("/browse/");
|
||||||
|
|
||||||
|
// Exercise the Angular workaround
|
||||||
|
mockScope.$on.mostRecentCall.args[1]();
|
||||||
|
expect(mockUnlisten).toHaveBeenCalled();
|
||||||
|
|
||||||
// location.path to be called with the urlService's
|
// location.path to be called with the urlService's
|
||||||
// urlFor function with the next domainObject and mode
|
// urlFor function with the next domainObject and mode
|
||||||
expect(mockLocation.path).toHaveBeenCalledWith(
|
expect(mockLocation.path).toHaveBeenCalledWith(
|
||||||
mockUrlService.urlForLocation(mockMode, mockNextObject)
|
mockUrlService.urlForLocation(mockMode, mockNextObject)
|
||||||
);
|
);
|
||||||
|
|
||||||
// Exercise the Angular workaround
|
|
||||||
mockScope.$on.mostRecentCall.args[1]();
|
|
||||||
expect(mockUnlisten).toHaveBeenCalled();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@ -68,6 +68,10 @@ define(
|
|||||||
fireWatch("representation.selected.key", "xyz");
|
fireWatch("representation.selected.key", "xyz");
|
||||||
expect(mockLocation.search).toHaveBeenCalledWith('view', "xyz");
|
expect(mockLocation.search).toHaveBeenCalledWith('view', "xyz");
|
||||||
|
|
||||||
|
// Allows the path index to be checked
|
||||||
|
// prior to setting $route.current
|
||||||
|
mockLocation.path.andReturn("/browse/");
|
||||||
|
|
||||||
// Exercise the Angular workaround
|
// Exercise the Angular workaround
|
||||||
mockScope.$on.mostRecentCall.args[1]();
|
mockScope.$on.mostRecentCall.args[1]();
|
||||||
expect(mockUnlisten).toHaveBeenCalled();
|
expect(mockUnlisten).toHaveBeenCalled();
|
||||||
|
Loading…
Reference in New Issue
Block a user