mirror of
https://github.com/nasa/openmct.git
synced 2025-02-21 17:57:04 +00:00
[Persistence] Test validator
Exercise the validation function provided by move/copy/link actions when prompting for a location with a dialog.
This commit is contained in:
parent
7114e9b150
commit
adf119007b
@ -151,6 +151,30 @@ define(
|
|||||||
expect(composeService.perform)
|
expect(composeService.perform)
|
||||||
.toHaveBeenCalledWith(selectedObject, newParent);
|
.toHaveBeenCalledWith(selectedObject, newParent);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe("provides a validator which", function () {
|
||||||
|
var validator;
|
||||||
|
|
||||||
|
beforeEach(function () {
|
||||||
|
validator = locationService.getLocationFromUser
|
||||||
|
.mostRecentCall.args[2];
|
||||||
|
composeService.validate.andReturn(true);
|
||||||
|
policyService.allow.andReturn(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("is sensitive to policy", function () {
|
||||||
|
expect(validator()).toBe(true);
|
||||||
|
policyService.allow.andReturn(false);
|
||||||
|
expect(validator()).toBe(false);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("is sensitive to service-specific validation", function () {
|
||||||
|
expect(validator()).toBe(true);
|
||||||
|
composeService.validate.andReturn(false);
|
||||||
|
expect(validator()).toBe(false);
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user