[Entanglement] Verify revalidation
Verify that move/copy/link revalidate when performed and throw errors when moving/copying/linking would be invalid. nasa/openmctweb#98
This commit is contained in:
@@ -220,6 +220,17 @@ define(
|
||||
compositionPromise.resolve([linkedObject]);
|
||||
expect(whenComplete).toHaveBeenCalledWith(linkedObject);
|
||||
});
|
||||
|
||||
it("throws an expection when performed on invalid inputs", function () {
|
||||
function perform() {
|
||||
linkService.perform(object, parentObject);
|
||||
}
|
||||
|
||||
mockPolicyService.allow.andReturn(true);
|
||||
expect(perform).not.toThrow();
|
||||
mockPolicyService.allow.andReturn(false); // Cause validate to fail
|
||||
expect(perform).toThrow();
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user