mirror of
https://github.com/nasa/openmct.git
synced 2025-06-13 12:48:14 +00:00
[Forms] Complete specs
Fill in new specs and amend existing specs to ensure full coverage after integration of forms component, and associated changes. WTD-593.
This commit is contained in:
@ -52,11 +52,13 @@ define(
|
||||
// Verify precondition
|
||||
expect(controller.isSelected()).toBeFalsy();
|
||||
|
||||
// mockNavigationService.getNavigation.andReturn(obj);
|
||||
// mockScope.domainObject = obj;
|
||||
// mockNavigationService.addListener.mostRecentCall.args[0](obj);
|
||||
// Change the represented domain object
|
||||
mockScope.domainObject = obj;
|
||||
|
||||
//expect(controller.isSelected()).toBeTruthy();
|
||||
// Invoke the watch with the new selection
|
||||
mockScope.$watch.calls[0].args[1](obj);
|
||||
|
||||
expect(controller.isSelected()).toBeTruthy();
|
||||
});
|
||||
|
||||
it("expands a node if it is on the navigation path", function () {
|
||||
@ -80,9 +82,12 @@ define(
|
||||
mockScope.domainObject = parent;
|
||||
mockScope.toggle = jasmine.createSpyObj("toggle", ["setState"]);
|
||||
|
||||
// expect(mockScope.toggle.setState).toHaveBeenCalledWith(true);
|
||||
// expect(controller.hasBeenExpanded()).toBeTruthy();
|
||||
// expect(controller.isSelected()).toBeFalsy();
|
||||
// Invoke the watch with the new selection
|
||||
mockScope.$watch.calls[0].args[1](child);
|
||||
|
||||
expect(mockScope.toggle.setState).toHaveBeenCalledWith(true);
|
||||
expect(controller.hasBeenExpanded()).toBeTruthy();
|
||||
expect(controller.isSelected()).toBeFalsy();
|
||||
|
||||
});
|
||||
|
||||
@ -107,12 +112,12 @@ define(
|
||||
mockScope.domainObject = parent;
|
||||
mockScope.toggle = jasmine.createSpyObj("toggle", ["setState"]);
|
||||
|
||||
// Trigger update
|
||||
// mockNavigationService.addListener.mostRecentCall.args[0](child);
|
||||
//
|
||||
// expect(mockScope.toggle.setState).not.toHaveBeenCalled();
|
||||
// expect(controller.hasBeenExpanded()).toBeFalsy();
|
||||
// expect(controller.isNavigated()).toBeFalsy();
|
||||
// Invoke the watch with the new selection
|
||||
mockScope.$watch.calls[0].args[1](child);
|
||||
|
||||
expect(mockScope.toggle.setState).not.toHaveBeenCalled();
|
||||
expect(controller.hasBeenExpanded()).toBeFalsy();
|
||||
expect(controller.isSelected()).toBeFalsy();
|
||||
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user