From c588d63d5bd2ffa8d4ba61c0d4c68f933552519f Mon Sep 17 00:00:00 2001 From: Kayla Firestack Date: Mon, 25 Nov 2024 17:53:47 -0500 Subject: [PATCH] test(ex/skate/ors): Update test cases --- lib/skate/open_route_service_api.ex | 4 ++-- test/skate/open_route_service_api_test.exs | 10 ++++++++-- .../controllers/detour_route_controller_test.exs | 15 +++++++++------ .../controllers/detours_controller_test.exs | 15 +++++++++------ 4 files changed, 28 insertions(+), 16 deletions(-) diff --git a/lib/skate/open_route_service_api.ex b/lib/skate/open_route_service_api.ex index 1b45f84d6..9ac9f17b6 100644 --- a/lib/skate/open_route_service_api.ex +++ b/lib/skate/open_route_service_api.ex @@ -24,10 +24,10 @@ defmodule Skate.OpenRouteServiceAPI do ], directions: [ %{ - instruction: "Turn right onto 1st Avenue" + instruction: "R - 1st Avenue" }, %{ - instruction: "Turn left onto 2nd Place" + instruction: "L - 2nd Place" } ] } diff --git a/test/skate/open_route_service_api_test.exs b/test/skate/open_route_service_api_test.exs index a9162dcf4..d3d7897d8 100644 --- a/test/skate/open_route_service_api_test.exs +++ b/test/skate/open_route_service_api_test.exs @@ -84,15 +84,18 @@ defmodule Skate.OpenRouteServiceAPITest do "steps" => [ %{ "instruction" => "not-in-results", + "name" => "not-in-results", # Depart "type" => 11 }, %{ "instruction" => "1", + "name" => "A Street", "type" => 1 }, %{ "instruction" => "not-in-results", + "name" => "not-in-results", # Goal "type" => 10 } @@ -102,16 +105,19 @@ defmodule Skate.OpenRouteServiceAPITest do "steps" => [ %{ "instruction" => "not-in-results", + "name" => "not-in-results", # Depart "type" => 11 }, %{ "instruction" => "not-in-results", + "name" => "not-in-results", # Straight "type" => 6 }, %{ "instruction" => "2", + "name" => "B Drive", "type" => 0 } ] @@ -124,8 +130,8 @@ defmodule Skate.OpenRouteServiceAPITest do assert {:ok, %DirectionsResponse{ directions: [ - %{instruction: "1"}, - %{instruction: "2"} + %{instruction: "R - A Street"}, + %{instruction: "L - B Drive"} ] }} = Skate.OpenRouteServiceAPI.directions([ diff --git a/test/skate_web/controllers/detour_route_controller_test.exs b/test/skate_web/controllers/detour_route_controller_test.exs index 7c864d32f..82a757f44 100644 --- a/test/skate_web/controllers/detour_route_controller_test.exs +++ b/test/skate_web/controllers/detour_route_controller_test.exs @@ -66,11 +66,13 @@ defmodule SkateWeb.DetourRouteControllerTest do "steps" => [ %{ "instruction" => "1", - "type" => 1 + "type" => 1, + "name" => "First Street" }, %{ "instruction" => "2", - "type" => 0 + "type" => 0, + "name" => "Second Street" } ] }, @@ -78,7 +80,8 @@ defmodule SkateWeb.DetourRouteControllerTest do "steps" => [ %{ "instruction" => "3", - "type" => 2 + "type" => 2, + "name" => "Third Street" } ] } @@ -94,9 +97,9 @@ defmodule SkateWeb.DetourRouteControllerTest do assert %{ "data" => %{ "directions" => [ - %{"instruction" => "1"}, - %{"instruction" => "2"}, - %{"instruction" => "3"} + %{"instruction" => "R - First Street"}, + %{"instruction" => "L - Second Street"}, + %{"instruction" => "Sharp L - Third Street"} ] } } = diff --git a/test/skate_web/controllers/detours_controller_test.exs b/test/skate_web/controllers/detours_controller_test.exs index a604487d7..f892858ea 100644 --- a/test/skate_web/controllers/detours_controller_test.exs +++ b/test/skate_web/controllers/detours_controller_test.exs @@ -786,11 +786,13 @@ defmodule SkateWeb.DetoursControllerTest do "steps" => [ %{ "instruction" => "1", - "type" => 1 + "type" => 1, + "name" => "A" }, %{ "instruction" => "2", - "type" => 0 + "type" => 0, + "name" => "B" } ] }, @@ -798,7 +800,8 @@ defmodule SkateWeb.DetoursControllerTest do "steps" => [ %{ "instruction" => "3", - "type" => 2 + "type" => 2, + "name" => "C" } ] } @@ -836,9 +839,9 @@ defmodule SkateWeb.DetoursControllerTest do "data" => %{ "detour_shape" => %{ "directions" => [ - %{"instruction" => "1"}, - %{"instruction" => "2"}, - %{"instruction" => "3"} + %{"instruction" => "R - A"}, + %{"instruction" => "L - B"}, + %{"instruction" => "Sharp L - C"} ] } }