mirror of
https://github.com/nasa/openmct.git
synced 2025-01-31 08:25:31 +00:00
Updated tests
This commit is contained in:
parent
2fe7ba982f
commit
519a9333ab
@ -58,16 +58,25 @@ define(
|
|||||||
expect(policy.allow(mockAction, context)).toBe(true);
|
expect(policy.allow(mockAction, context)).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Allows no actions when navigated object in edit mode, but' +
|
it('Allows "window" action when navigated object in edit mode,' +
|
||||||
' selected object not in edit mode ', function() {
|
' but selected object not in edit mode ', function() {
|
||||||
navigatedObject.hasCapability.andReturn(true);
|
navigatedObject.hasCapability.andReturn(true);
|
||||||
|
metadata.key = "window";
|
||||||
|
expect(policy.allow(mockAction, context)).toBe(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Disallows "move" action when navigated object in edit mode,' +
|
||||||
|
' but selected object not in edit mode ', function() {
|
||||||
|
navigatedObject.hasCapability.andReturn(true);
|
||||||
|
metadata.key = "move";
|
||||||
expect(policy.allow(mockAction, context)).toBe(false);
|
expect(policy.allow(mockAction, context)).toBe(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Disallows blacklisted actions when navigated object and' +
|
it('Disallows copy action when navigated object and' +
|
||||||
' selected object in edit mode', function() {
|
' selected object in edit mode', function() {
|
||||||
navigatedObject.hasCapability.andReturn(true);
|
navigatedObject.hasCapability.andReturn(true);
|
||||||
mockDomainObject.hasCapability.andReturn(true);
|
mockDomainObject.hasCapability.andReturn(true);
|
||||||
|
metadata.key = "copy";
|
||||||
expect(policy.allow(mockAction, context)).toBe(false);
|
expect(policy.allow(mockAction, context)).toBe(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user