mirror of
https://github.com/nasa/openmct.git
synced 2025-01-19 03:06:54 +00:00
[Search] Update tests
for 100% coverage.
This commit is contained in:
parent
17f2bb966b
commit
3d1e1659c2
@ -199,6 +199,10 @@ define(
|
||||
mockPromise.then.mostRecentCall.args[0]({hits: [], total: 0});
|
||||
expect(mockScope.ngModel.search).toEqual(false);
|
||||
});
|
||||
|
||||
it("has a default results list to filter from", function () {
|
||||
expect(mockScope.ngModel.filter()).toBeDefined();
|
||||
});
|
||||
});
|
||||
}
|
||||
);
|
@ -119,8 +119,12 @@ define(
|
||||
|
||||
// Call through the children-getting part
|
||||
mockTimeout.mostRecentCall.args[0]();
|
||||
// Array argument indicates multiple children
|
||||
mockCapabilityPromise.then.mostRecentCall.args[0]([]);
|
||||
mockTimeout.mostRecentCall.args[0]();
|
||||
// Call again, but for single child
|
||||
mockCapabilityPromise.then.mostRecentCall.args[0]({});
|
||||
mockTimeout.mostRecentCall.args[0]();
|
||||
|
||||
expect(mockWorker.postMessage).toHaveBeenCalled();
|
||||
});
|
||||
@ -150,6 +154,19 @@ define(
|
||||
});
|
||||
});
|
||||
|
||||
it("gives an empty result for an empty query", function () {
|
||||
var timestamp = Date.now(),
|
||||
queryOutput;
|
||||
|
||||
queryOutput = provider.query('', timestamp, 1, 2);
|
||||
expect(queryOutput.hits).toEqual([]);
|
||||
expect(queryOutput.total).toEqual(0);
|
||||
|
||||
queryOutput = provider.query();
|
||||
expect(queryOutput.hits).toEqual([]);
|
||||
expect(queryOutput.total).toEqual(0);
|
||||
});
|
||||
|
||||
it("handles responses from the worker", function () {
|
||||
var timestamp = Date.now(),
|
||||
event = {
|
||||
|
Loading…
Reference in New Issue
Block a user