import { describe, it, expect } from "vitest";
import { transformSuggestionsResponse } from "./index";
describe("transformSuggestionsResponse", () => {
    it("should transform Mapbox suggestions response to internal format", () => {
        const mapboxResponse = {
            type: "FeatureCollection",
            features: [
                {
                    type: "Feature",
                    geometry: {
                        type: "Point",
                        coordinates: [-72, 42],
                    },
                    properties: {
                        mapbox_id: "place-1",
                        name: "Place 1",
                        language: "en",
                        feature_type: "address",
                        place_formatted: "place-1_formatted",
                        context: {
                            country: {
                                name: "place-1_country",
                                country_code: "place-1_country_code",
                                country_code_alpha_3: "place-1_country_code_alpha_3",
                            },
                            region: {
                                name: "place-1_region",
                                region_code: "place-1_region_code",
                                region_code_full: "place-1_region_code_full",
                            },
                            postcode: {
                                name: "place-1_postcode",
                            },
                            district: {
                                name: "place-1_district",
                            },
                            place: {
                                name: "place-1_place",
                            },
                            neighborhood: {
                                name: "place-1_neighborhood",
                            },
                            address: {
                                name: "place-1_address_name",
                                address_number: "place-1_address_number",
                                street_name: "place-1_address_street_name",
                            },
                            street: {
                                name: "place-1_street",
                            },
                        },
                        coordinates: {
                            latitude: -72,
                            longitude: 42,
                            accuracy: "",
                        },
                    },
                },
            ],
        };
        const response = transformSuggestionsResponse(mapboxResponse);
        expect(response).toEqual({
            suggestions: [
                {
                    label: "Place 1",
                    language: "en",
                    countryCode: "place-1_country_code_alpha_3",
                    locationId: "place-1",
                    address: {
                        description: "Place 1, place-1_formatted",
                        country: "place-1_country",
                        state: "place-1_region_code",
                        city: "place-1_place",
                        postalCode: "place-1_postcode",
                        county: "place-1_district",
                        street: "place-1_address_street_name",
                        houseNumber: "place-1_address_number",
                        coordinates: {
                            latitude: -72,
                            longitude: 42,
                        },
                    },
                },
            ],
        });
    });
});
//# sourceMappingURL=index.test.js.map