mirror of
https://github.com/nasa/openmct.git
synced 2025-01-19 11:17:04 +00:00
[Fixed Position] Add tests for FixedController
Add tests for FixedController and FixedProxy which reflect added/changed behavior for Add button, WTD-880.
This commit is contained in:
parent
6814567116
commit
e50e57b0be
@ -272,8 +272,6 @@ define(
|
||||
.toHaveBeenCalledWith(jasmine.any(String));
|
||||
});
|
||||
|
||||
|
||||
|
||||
it("unsubscribes when destroyed", function () {
|
||||
// Make an object available
|
||||
findWatch('domainObject')(mockDomainObject);
|
||||
@ -284,6 +282,12 @@ define(
|
||||
// Should have unsubscribed
|
||||
expect(mockSubscription.unsubscribe).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("exposes its grid size", function () {
|
||||
// Template needs to be able to pass this into line
|
||||
// elements to size SVGs appropriately
|
||||
expect(controller.getGridSize()).toEqual(testGrid);
|
||||
});
|
||||
});
|
||||
}
|
||||
);
|
@ -29,6 +29,23 @@ define(
|
||||
proxy.add("fixed.box");
|
||||
expect(mockQ.when).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("notifies its callback when an element is created", function () {
|
||||
proxy.add("fixed.box");
|
||||
// Callback should not have been invoked yet
|
||||
expect(mockCallback).not.toHaveBeenCalled();
|
||||
// Resolve the promise
|
||||
mockPromise.then.mostRecentCall.args[0]({});
|
||||
// Should have fired the callback
|
||||
expect(mockCallback).toHaveBeenCalledWith({
|
||||
type: "fixed.box",
|
||||
x: 0,
|
||||
y: 0,
|
||||
width: 1,
|
||||
height: 1
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user