mirror of
https://github.com/nasa/openmct.git
synced 2025-06-14 13:18:15 +00:00
[search] Reverted previous change to ClickAwayController and introduced a custom fix to search menu. Fixes #888 (#1109)
This commit is contained in:
committed by
Pete Richards
parent
4d89de7068
commit
0274490b68
@ -26,7 +26,7 @@ define(
|
||||
|
||||
describe("The click-away controller", function () {
|
||||
var mockDocument,
|
||||
mockScope,
|
||||
mockTimeout,
|
||||
controller;
|
||||
|
||||
beforeEach(function () {
|
||||
@ -34,11 +34,10 @@ define(
|
||||
"$document",
|
||||
["on", "off"]
|
||||
);
|
||||
mockScope = jasmine.createSpyObj('$scope', ['$apply']);
|
||||
|
||||
mockTimeout = jasmine.createSpy('timeout');
|
||||
controller = new ClickAwayController(
|
||||
mockDocument,
|
||||
mockScope
|
||||
mockTimeout
|
||||
);
|
||||
});
|
||||
|
||||
@ -78,15 +77,18 @@ define(
|
||||
});
|
||||
|
||||
it("deactivates and detaches listener on document click", function () {
|
||||
var callback, apply;
|
||||
var callback, timeout;
|
||||
controller.setState(true);
|
||||
callback = mockDocument.on.mostRecentCall.args[1];
|
||||
callback();
|
||||
apply = mockScope.$apply.mostRecentCall.args[0];
|
||||
apply();
|
||||
timeout = mockTimeout.mostRecentCall.args[0];
|
||||
timeout();
|
||||
expect(controller.isActive()).toEqual(false);
|
||||
expect(mockDocument.off).toHaveBeenCalledWith("mouseup", callback);
|
||||
});
|
||||
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
);
|
||||
|
Reference in New Issue
Block a user