Skip to content

Commit

Permalink
Added new international autocomplete fields for admin area short and …
Browse files Browse the repository at this point in the history
…long.
  • Loading branch information
Bryan Amundson committed Jul 2, 2024
1 parent 4a99e28 commit ec895b7
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 15 deletions.
12 changes: 7 additions & 5 deletions international-autocomplete-api/candidate.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package international_autocomplete_api

type Candidate struct {
Street string `json:"street"`
Locality string `json:"locality"`
AdministrativeArea string `json:"administrative_area"`
PostalCode string `json:"postal_code"`
CountryIso3 string `json:"country_iso3"`
Street string `json:"street"`
Locality string `json:"locality"`
AdministrativeArea string `json:"administrative_area"`
AdministrativeAreaShort string `json:"administrative_area_short"`
AdministrativeAreaLong string `json:"administrative_area_long"`
PostalCode string `json:"postal_code"`
CountryIso3 string `json:"country_iso3"`

Entries int `json:"entries"`
AddressText string `json:"address_text"`
Expand Down
28 changes: 18 additions & 10 deletions international-autocomplete-api/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,17 @@ func (f *ClientFixture) TestAddressLookupSerializedAndSentWithContext__ResponseS
"street": "1",
"locality": "2",
"administrative_area": "3",
"administrative_area_short": "3.0",
"administrative_area_long": "3.1",
"postal_code": "4",
"country_iso3": "5"
},
{
"street": "6",
"locality": "7",
"administrative_area": "8",
"administrative_area_short": "8.0",
"administrative_area_long": "8.1",
"postal_code": "9",
"country_iso3": "10"
}
Expand All @@ -64,18 +68,22 @@ func (f *ClientFixture) TestAddressLookupSerializedAndSentWithContext__ResponseS

f.So(f.input.Result, should.Resemble, &Result{Candidates: []*Candidate{
{
Street: "1",
Locality: "2",
AdministrativeArea: "3",
PostalCode: "4",
CountryIso3: "5",
Street: "1",
Locality: "2",
AdministrativeArea: "3",
AdministrativeAreaShort: "3.0",
AdministrativeAreaLong: "3.1",
PostalCode: "4",
CountryIso3: "5",
},
{
Street: "6",
Locality: "7",
AdministrativeArea: "8",
PostalCode: "9",
CountryIso3: "10",
Street: "6",
Locality: "7",
AdministrativeArea: "8",
AdministrativeAreaShort: "8.0",
AdministrativeAreaLong: "8.1",
PostalCode: "9",
CountryIso3: "10",
},
}})
}
Expand Down

0 comments on commit ec895b7

Please sign in to comment.