diff --git a/src/us_autocomplete/Suggestion.ts b/src/us_autocomplete/Suggestion.ts index b85c18f..7b03c27 100644 --- a/src/us_autocomplete/Suggestion.ts +++ b/src/us_autocomplete/Suggestion.ts @@ -1,6 +1,7 @@ export interface RawUsAutocompleteSuggestion { smarty_key?: string; entry_id?: string; + urbanization?: string; street_line?: string; secondary?: string; city?: string; @@ -13,6 +14,7 @@ export interface RawUsAutocompleteSuggestion { export default class Suggestion { smartyKey: string; entryId: string; + urbanization: string; streetLine: string; secondary: string; city: string; @@ -24,6 +26,7 @@ export default class Suggestion { constructor(responseData: RawUsAutocompleteSuggestion) { this.smartyKey = responseData.smarty_key ?? ""; this.entryId = responseData.entry_id ?? ""; + this.urbanization = responseData.urbanization ?? ""; this.streetLine = responseData.street_line ?? ""; this.secondary = responseData.secondary ?? ""; this.city = responseData.city ?? ""; diff --git a/tests/us_autocomplete/test_Client.ts b/tests/us_autocomplete/test_Client.ts index f8ce6c7..46c7958 100644 --- a/tests/us_autocomplete/test_Client.ts +++ b/tests/us_autocomplete/test_Client.ts @@ -167,6 +167,7 @@ describe("A US Autocomplete Client", function () { const responseData = { smarty_key: "z", entry_id: "y", + urbanization: "urb", street_line: "a", secondary: "b", city: "c", diff --git a/tests/us_autocomplete/test_Suggestion.ts b/tests/us_autocomplete/test_Suggestion.ts index 17c2dc6..1e387a3 100644 --- a/tests/us_autocomplete/test_Suggestion.ts +++ b/tests/us_autocomplete/test_Suggestion.ts @@ -6,6 +6,7 @@ describe("A US Autocomplete Suggestion", function () { const mockSuggestion = { smarty_key: "z", entry_id: "y", + urbanization: "urb", street_line: "a", secondary: "b", city: "c", @@ -18,6 +19,7 @@ describe("A US Autocomplete Suggestion", function () { expect(suggestion.smartyKey).to.equal("z"); expect(suggestion.entryId).to.equal("y"); + expect(suggestion.urbanization).to.equal("urb"); expect(suggestion.streetLine).to.equal("a"); expect(suggestion.secondary).to.equal("b"); expect(suggestion.city).to.equal("c"); @@ -38,6 +40,7 @@ describe("A US Autocomplete Suggestion", function () { expect(suggestion.smartyKey).to.equal(""); expect(suggestion.entryId).to.equal(""); + expect(suggestion.urbanization).to.equal(""); expect(suggestion.entries).to.equal(0); expect(suggestion.source).to.equal(""); });