mirror of
https://github.com/nasa/openmct.git
synced 2024-12-20 05:37:53 +00:00
[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:
parent
6996883b85
commit
4743833f7c
@ -285,6 +285,20 @@ define(
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("throws an expection when performed on invalid inputs", function () {
|
||||||
|
var copyService =
|
||||||
|
new CopyService(mockQ, creationService, policyService);
|
||||||
|
|
||||||
|
function perform() {
|
||||||
|
copyService.perform(object, newParent);
|
||||||
|
}
|
||||||
|
|
||||||
|
policyService.allow.andReturn(true);
|
||||||
|
expect(perform).not.toThrow();
|
||||||
|
policyService.allow.andReturn(false); // Cause validate to fail
|
||||||
|
expect(perform).toThrow();
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -220,6 +220,17 @@ define(
|
|||||||
compositionPromise.resolve([linkedObject]);
|
compositionPromise.resolve([linkedObject]);
|
||||||
expect(whenComplete).toHaveBeenCalledWith(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();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -196,6 +196,17 @@ define(
|
|||||||
.toHaveBeenCalledWith(jasmine.any(Function));
|
.toHaveBeenCalledWith(jasmine.any(Function));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("throws an expection when performed on invalid inputs", function () {
|
||||||
|
function perform() {
|
||||||
|
moveService.perform(object, newParent);
|
||||||
|
}
|
||||||
|
|
||||||
|
policyService.allow.andReturn(true);
|
||||||
|
expect(perform).not.toThrow();
|
||||||
|
policyService.allow.andReturn(false); // Cause validate to fail
|
||||||
|
expect(perform).toThrow();
|
||||||
|
});
|
||||||
|
|
||||||
describe("when moving an original", function () {
|
describe("when moving an original", function () {
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
locationCapability.getContextualLocation
|
locationCapability.getContextualLocation
|
||||||
|
Loading…
Reference in New Issue
Block a user