diff --git a/packages/components/src/lib/geolocation/geolocation.spec.ts b/packages/components/src/lib/geolocation/geolocation.spec.ts index f0af1c67..e8b1f1e3 100644 --- a/packages/components/src/lib/geolocation/geolocation.spec.ts +++ b/packages/components/src/lib/geolocation/geolocation.spec.ts @@ -57,9 +57,9 @@ describe("geolocation tests", () => { latitude: null, longitude: null, address: `Endereço não encontrado - ${validOutput.address}`, - state: null, - city: "ZERO_RESULTS", - cep: null + state: "not_found", + city: "not_found", + cep: "not_found" }; it("should return valid output if there are results", () => { diff --git a/packages/components/src/lib/geolocation/index.ts b/packages/components/src/lib/geolocation/index.ts index 9d87bd19..2e1d5dc9 100644 --- a/packages/components/src/lib/geolocation/index.ts +++ b/packages/components/src/lib/geolocation/index.ts @@ -16,10 +16,10 @@ const log = logger.child({ module: "geolocation" }); const getCityStateAndZipcode = ( addressComponents: AddressComponent ): Array => { - let state = ""; - let city = ""; - let zipcode = ""; - let country = ""; + let state = "not_found"; + let city = "not_found"; + let zipcode = "not_found"; + let country = "BR"; addressComponents.forEach(({ types, short_name: shortName }) => { if (types.includes("postal_code")) { @@ -59,9 +59,9 @@ const geolocationUnkown = ({ latitude: null, longitude: null, address: `Endereço não encontrado - ${address || zipcode}`, - state: null, - city: "ZERO_RESULTS", - cep: zipcode || null + state: "not_found", + city: "not_found", + cep: zipcode || "not_found" }); const parseZipcode = (zipcode: string): string => {