# frozen_string_literal: true

require "spec_helper"

describe ShippingDestination::Destinations do
  describe ".shipping_countries" do
    it "returns the expected shipping countries" do
      expect(ShippingDestination::Destinations.shipping_countries).to eq(shipping_countries_expected)
    end
  end

  describe ".europe_shipping_countries" do
    it "returns the expected Europe countries mapping" do
      expect(ShippingDestination::Destinations.europe_shipping_countries).to eq(europe_shipping_countries_expected)
    end
  end

  describe ".asia_shipping_countries" do
    it "returns the expected Asia countries mapping" do
      expect(ShippingDestination::Destinations.asia_shipping_countries).to eq(asia_shipping_countries_expected)
    end
  end

  describe ".north_america_shipping_countries" do
    it "returns the expected North America countries mapping" do
      expect(ShippingDestination::Destinations.north_america_shipping_countries).to eq(north_america_shipping_countries_expected)
    end
  end

  def shipping_countries_expected
    {
      "US" => "United States",
      "ASIA" => "Asia",
      "EUROPE" => "Europe",
      "NORTH AMERICA" => "North America",
      "ELSEWHERE" => "Elsewhere",
      "AX" => "Åland Islands",
      "AL" => "Albania",
      "DZ" => "Algeria",
      "AS" => "American Samoa",
      "AD" => "Andorra",
      "AO" => "Angola",
      "AI" => "Anguilla",
      "AQ" => "Antarctica",
      "AG" => "Antigua and Barbuda",
      "AR" => "Argentina",
      "AM" => "Armenia",
      "AW" => "Aruba",
      "AU" => "Australia",
      "AT" => "Austria",
      "AZ" => "Azerbaijan",
      "BS" => "Bahamas",
      "BH" => "Bahrain",
      "BD" => "Bangladesh",
      "BB" => "Barbados",
      "BY" => "Belarus",
      "BE" => "Belgium",
      "BZ" => "Belize",
      "BJ" => "Benin",
      "BM" => "Bermuda",
      "BT" => "Bhutan",
      "BO" => "Bolivia",
      "BQ" => "Bonaire, Sint Eustatius and Saba",
      "BA" => "Bosnia and Herzegovina",
      "BW" => "Botswana",
      "BV" => "Bouvet Island",
      "BR" => "Brazil",
      "IO" => "British Indian Ocean Territory",
      "BN" => "Brunei Darussalam",
      "BG" => "Bulgaria",
      "BF" => "Burkina Faso",
      "BI" => "Burundi",
      "KH" => "Cambodia",
      "CM" => "Cameroon",
      "CA" => "Canada",
      "CV" => "Cabo Verde",
      "KY" => "Cayman Islands",
      "CF" => "Central African Republic",
      "TD" => "Chad",
      "CL" => "Chile",
      "CN" => "China",
      "CX" => "Christmas Island",
      "CC" => "Cocos (Keeling) Islands",
      "CO" => "Colombia",
      "KM" => "Comoros",
      "CG" => "Congo",
      "CK" => "Cook Islands",
      "CR" => "Costa Rica",
      "HR" => "Croatia",
      "CW" => "Curaçao",
      "CY" => "Cyprus",
      "CZ" => "Czechia",
      "DK" => "Denmark",
      "DJ" => "Djibouti",
      "DM" => "Dominica",
      "DO" => "Dominican Republic",
      "EC" => "Ecuador",
      "EG" => "Egypt",
      "SV" => "El Salvador",
      "GQ" => "Equatorial Guinea",
      "ER" => "Eritrea",
      "EE" => "Estonia",
      "ET" => "Ethiopia",
      "FK" => "Falkland Islands (Malvinas)",
      "FO" => "Faroe Islands",
      "FJ" => "Fiji",
      "FI" => "Finland",
      "FR" => "France",
      "GF" => "French Guiana",
      "PF" => "French Polynesia",
      "TF" => "French Southern Territories",
      "GA" => "Gabon",
      "GM" => "Gambia",
      "DE" => "Germany",
      "GH" => "Ghana",
      "GI" => "Gibraltar",
      "GR" => "Greece",
      "GL" => "Greenland",
      "GD" => "Grenada",
      "GE" => "Georgia",
      "GP" => "Guadeloupe",
      "GU" => "Guam",
      "GT" => "Guatemala",
      "GG" => "Guernsey",
      "GN" => "Guinea",
      "GW" => "Guinea-Bissau",
      "GY" => "Guyana",
      "HT" => "Haiti",
      "HM" => "Heard Island and McDonald Islands",
      "VA" => "Holy See (Vatican City State)",
      "HN" => "Honduras",
      "HK" => "Hong Kong",
      "HU" => "Hungary",
      "IS" => "Iceland",
      "IN" => "India",
      "ID" => "Indonesia",
      "IE" => "Ireland",
      "IM" => "Isle of Man",
      "IL" => "Israel",
      "IT" => "Italy",
      "JM" => "Jamaica",
      "JP" => "Japan",
      "JE" => "Jersey",
      "JO" => "Jordan",
      "KZ" => "Kazakhstan",
      "KE" => "Kenya",
      "KI" => "Kiribati",
      "KR" => "South Korea",
      "XK" => "Kosovo",
      "KW" => "Kuwait",
      "KG" => "Kyrgyzstan",
      "LA" => "Lao People's Democratic Republic",
      "LV" => "Latvia",
      "LS" => "Lesotho",
      "LI" => "Liechtenstein",
      "LT" => "Lithuania",
      "LU" => "Luxembourg",
      "MO" => "Macao",
      "MK" => "North Macedonia",
      "MG" => "Madagascar",
      "MW" => "Malawi",
      "MY" => "Malaysia",
      "MV" => "Maldives",
      "ML" => "Mali",
      "MT" => "Malta",
      "MH" => "Marshall Islands",
      "MQ" => "Martinique",
      "MR" => "Mauritania",
      "MU" => "Mauritius",
      "YT" => "Mayotte",
      "MX" => "Mexico",
      "FM" => "Micronesia, Federated States of",
      "MD" => "Moldova",
      "MC" => "Monaco",
      "MN" => "Mongolia",
      "ME" => "Montenegro",
      "MS" => "Montserrat",
      "MA" => "Morocco",
      "MZ" => "Mozambique",
      "NA" => "Namibia",
      "NR" => "Nauru",
      "NP" => "Nepal",
      "NL" => "Netherlands",
      "NC" => "New Caledonia",
      "NZ" => "New Zealand",
      "NI" => "Nicaragua",
      "NE" => "Niger",
      "NG" => "Nigeria",
      "NU" => "Niue",
      "NF" => "Norfolk Island",
      "MP" => "Northern Mariana Islands",
      "NO" => "Norway",
      "OM" => "Oman",
      "PK" => "Pakistan",
      "PW" => "Palau",
      "PS" => "Palestine, State of",
      "PA" => "Panama",
      "PG" => "Papua New Guinea",
      "PY" => "Paraguay",
      "PE" => "Peru",
      "PH" => "Philippines",
      "PN" => "Pitcairn",
      "PL" => "Poland",
      "PT" => "Portugal",
      "PR" => "Puerto Rico",
      "QA" => "Qatar",
      "RE" => "Réunion",
      "RO" => "Romania",
      "RU" => "Russian Federation",
      "RW" => "Rwanda",
      "BL" => "Saint Barthélemy",
      "SH" => "Saint Helena, Ascension and Tristan da Cunha",
      "KN" => "Saint Kitts and Nevis",
      "LC" => "Saint Lucia",
      "MF" => "Saint Martin (French part)",
      "PM" => "Saint Pierre and Miquelon",
      "VC" => "Saint Vincent and the Grenadines",
      "WS" => "Samoa",
      "SM" => "San Marino",
      "ST" => "Sao Tome and Principe",
      "SA" => "Saudi Arabia",
      "SN" => "Senegal",
      "RS" => "Serbia",
      "SC" => "Seychelles",
      "SL" => "Sierra Leone",
      "SG" => "Singapore",
      "SX" => "Sint Maarten (Dutch part)",
      "SK" => "Slovakia",
      "SI" => "Slovenia",
      "SB" => "Solomon Islands",
      "ZA" => "South Africa",
      "GS" => "South Georgia and the South Sandwich Islands",
      "SS" => "South Sudan",
      "ES" => "Spain",
      "LK" => "Sri Lanka",
      "SR" => "Suriname",
      "SJ" => "Svalbard and Jan Mayen",
      "SZ" => "Eswatini",
      "SE" => "Sweden",
      "CH" => "Switzerland",
      "TW" => "Taiwan",
      "TJ" => "Tajikistan",
      "TZ" => "Tanzania",
      "TH" => "Thailand",
      "TL" => "Timor-Leste",
      "TG" => "Togo",
      "TK" => "Tokelau",
      "TO" => "Tonga",
      "TT" => "Trinidad and Tobago",
      "TN" => "Tunisia",
      "TR" => "Türkiye",
      "TM" => "Turkmenistan",
      "TC" => "Turks and Caicos Islands",
      "TV" => "Tuvalu",
      "UG" => "Uganda",
      "UA" => "Ukraine",
      "AE" => "United Arab Emirates",
      "GB" => "United Kingdom",
      "UM" => "United States Minor Outlying Islands",
      "UY" => "Uruguay",
      "UZ" => "Uzbekistan",
      "VU" => "Vanuatu",
      "VE" => "Venezuela",
      "VN" => "Vietnam",
      "VG" => "Virgin Islands, British",
      "VI" => "Virgin Islands, U.S.",
      "WF" => "Wallis and Futuna",
      "EH" => "Western Sahara",
      "ZM" => "Zambia"
    }
  end

  def europe_shipping_countries_expected
    {
      "AD" => "Andorra",
      "AT" => "Austria",
      "BY" => "Belarus",
      "BE" => "Belgium",
      "BA" => "Bosnia and Herzegovina",
      "BG" => "Bulgaria",
      "HR" => "Croatia",
      "CZ" => "Czechia",
      "DK" => "Denmark",
      "EE" => "Estonia",
      "FO" => "Faroe Islands",
      "FI" => "Finland",
      "FR" => "France",
      "DE" => "Germany",
      "GI" => "Gibraltar",
      "GR" => "Greece",
      "GG" => "Guernsey",
      "VA" => "Holy See (Vatican City State)",
      "HU" => "Hungary",
      "IS" => "Iceland",
      "IE" => "Ireland",
      "IM" => "Isle of Man",
      "IT" => "Italy",
      "JE" => "Jersey",
      "XK" => "Kosovo",
      "LV" => "Latvia",
      "LI" => "Liechtenstein",
      "LU" => "Luxembourg",
      "MT" => "Malta",
      "MD" => "Moldova",
      "MC" => "Monaco",
      "ME" => "Montenegro",
      "NL" => "Netherlands",
      "MK" => "North Macedonia",
      "NO" => "Norway",
      "PL" => "Poland",
      "PT" => "Portugal",
      "RO" => "Romania",
      "RU" => "Russian Federation",
      "SM" => "San Marino",
      "RS" => "Serbia",
      "SK" => "Slovakia",
      "SI" => "Slovenia",
      "ES" => "Spain",
      "SJ" => "Svalbard and Jan Mayen",
      "SE" => "Sweden",
      "CH" => "Switzerland",
      "TR" => "Türkiye",
      "UA" => "Ukraine",
      "GB" => "United Kingdom",
      "AX" => "Åland Islands"
    }
  end

  def asia_shipping_countries_expected
    {
      "AM" => "Armenia",
      "AZ" => "Azerbaijan",
      "BH" => "Bahrain",
      "BT" => "Bhutan",
      "IO" => "British Indian Ocean Territory",
      "BN" => "Brunei Darussalam",
      "KH" => "Cambodia",
      "CN" => "China",
      "CX" => "Christmas Island",
      "CC" => "Cocos (Keeling) Islands",
      "CY" => "Cyprus",
      "GE" => "Georgia",
      "HK" => "Hong Kong",
      "IN" => "India",
      "IL" => "Israel",
      "JP" => "Japan",
      "JO" => "Jordan",
      "KZ" => "Kazakhstan",
      "KW" => "Kuwait",
      "KG" => "Kyrgyzstan",
      "LA" => "Lao People's Democratic Republic",
      "MO" => "Macao",
      "MY" => "Malaysia",
      "MV" => "Maldives",
      "MN" => "Mongolia",
      "NP" => "Nepal",
      "OM" => "Oman",
      "PK" => "Pakistan",
      "PS" => "Palestine, State of",
      "PH" => "Philippines",
      "QA" => "Qatar",
      "SA" => "Saudi Arabia",
      "SG" => "Singapore",
      "KR" => "South Korea",
      "LK" => "Sri Lanka",
      "TW" => "Taiwan",
      "TJ" => "Tajikistan",
      "TH" => "Thailand",
      "TL" => "Timor-Leste",
      "TM" => "Turkmenistan",
      "AE" => "United Arab Emirates",
      "UZ" => "Uzbekistan"
    }
  end

  def north_america_shipping_countries_expected
    {
      "AI" => "Anguilla",
      "AG" => "Antigua and Barbuda",
      "AW" => "Aruba",
      "BS" => "Bahamas",
      "BB" => "Barbados",
      "BZ" => "Belize",
      "BM" => "Bermuda",
      "BQ" => "Bonaire, Sint Eustatius and Saba",
      "CA" => "Canada",
      "KY" => "Cayman Islands",
      "CR" => "Costa Rica",
      "CW" => "Curaçao",
      "DM" => "Dominica",
      "DO" => "Dominican Republic",
      "SV" => "El Salvador",
      "GL" => "Greenland",
      "GD" => "Grenada",
      "GP" => "Guadeloupe",
      "GT" => "Guatemala",
      "HT" => "Haiti",
      "HN" => "Honduras",
      "JM" => "Jamaica",
      "MQ" => "Martinique",
      "MX" => "Mexico",
      "MS" => "Montserrat",
      "NI" => "Nicaragua",
      "PR" => "Puerto Rico",
      "BL" => "Saint Barthélemy",
      "KN" => "Saint Kitts and Nevis",
      "LC" => "Saint Lucia",
      "MF" => "Saint Martin (French part)",
      "PM" => "Saint Pierre and Miquelon",
      "VC" => "Saint Vincent and the Grenadines",
      "SX" => "Sint Maarten (Dutch part)",
      "TT" => "Trinidad and Tobago",
      "TC" => "Turks and Caicos Islands",
      "US" => "United States",
      "VG" => "Virgin Islands, British",
      "VI" => "Virgin Islands, U.S."
    }
  end
end
