[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:
Victor Woeltjen
2015-02-20 15:59:22 -08:00
parent 6814567116
commit e50e57b0be
2 changed files with 23 additions and 2 deletions

View File

@@ -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
});
});
});
}
);