Skip to content

Commit

Permalink
Update Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
danbatsb committed Mar 2, 2017
1 parent 3123ee7 commit 516fc95
Showing 1 changed file with 21 additions and 19 deletions.
40 changes: 21 additions & 19 deletions js/tests/unit_tests/spec/DrilldownSpec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
var drilldownProps = {
enableSuggestions: false,
sources: [{
locator: null,
singleLineFieldName: "LH_ADDRESS",
Expand Down Expand Up @@ -144,25 +145,7 @@ describe("A set of tests for the Drilldown widget", function () {
done();
});

it("should handle a LocatorHub error message", function (done) {
require(["dojo/Deferred"], function (Deferred) {
widget.activeSourceIndex = 1;
var searchStub = sinon.stub(widget, "search").callsFake(function () {
var def = new Deferred();

this.emit("search-results", { "activeSourceIndex": 1, "errors": { 1: { "code": 400, "message": "Unable to complete operation", "details": ["NoMatchTooVague"] } } });
return def.resolve([]);
});



widget.search("1 Harrison Road")

expect(widget.errors).not.toEqual(null);

done();
});
});


it("should handle searching all sources", function (done) {
if (widget) {
Expand Down Expand Up @@ -211,4 +194,23 @@ describe("A set of tests for the Drilldown widget", function () {
});
});
});

it("should handle a LocatorHub error message", function (done) {
require(["dojo/Deferred"], function (Deferred) {
widget.activeSourceIndex = 1;
var searchStub = sinon.stub(widget, "search").callsFake(function () {
var def = new Deferred();

this.emit("search-results", { "activeSourceIndex": 1, "errors": { 1: { "code": 400, "message": "Unable to complete operation", "details": ["NoMatchTooVague"] } } });
this._buildPickListUi();

});

widget.search("1 Harrison Road")

expect(widget.errors).not.toEqual(null);

done();
});
});
});

0 comments on commit 516fc95

Please sign in to comment.