Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase coverage and consistency of trip planner tests #2336

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ defmodule DotcomWeb.Components.TripPlanner.ItineraryDetail do
variant="secondary"
phx-click="select_itinerary"
phx-value-index={index}
data-test={"itinerary_detail:#{index}"}
>
{Timex.format!(itinerary.start, "%-I:%M%p", :strftime) |> String.downcase()}
</.button>
Expand Down
2 changes: 2 additions & 0 deletions lib/dotcom_web/components/trip_planner/results.ex
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ defmodule DotcomWeb.Components.TripPlanner.Results do
<div
:if={Enum.count(@results.itinerary_groups) > 0 && @results.itinerary_group_selection}
class="h-min w-full mb-3.5"
data-test={"results:itinerary_group:selected:#{@results.itinerary_group_selection}"}
>
<button type="button" phx-click="reset_itinerary_group" class="btn-link">
<span class="flex flex-row items-center">
Expand Down Expand Up @@ -51,6 +52,7 @@ defmodule DotcomWeb.Components.TripPlanner.Results do
class="border border-solid border-gray-lighter p-4"
phx-click="select_itinerary_group"
phx-value-index={index}
data-test={"results:itinerary_group:#{index}"}
>
<div
:if={summary.tag}
Expand Down
4 changes: 3 additions & 1 deletion lib/dotcom_web/components/trip_planner/results_summary.ex
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ defmodule DotcomWeb.Components.TripPlanner.ResultsSummary do

defp results_feedback(assigns) do
~H"""
<.feedback kind={:error}>{@results.error}</.feedback>
<.feedback kind={:error}>
<span data-test="results-summary:error">{@results.error}</span>
</.feedback>
"""
end

Expand Down
2 changes: 1 addition & 1 deletion lib/dotcom_web/router.ex
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ defmodule DotcomWeb.Router do

scope "/preview", DotcomWeb do
import Phoenix.LiveView.Router
pipe_through([:browser, :browser_live, :basic_auth_readonly])
pipe_through([:browser, :browser_live])
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📓 Just did this for convenience since basic auth won't be there in the near future. Will remove this from the PR before merge.


live_session :rider, layout: {DotcomWeb.LayoutView, :preview} do
live("/trip-planner", Live.TripPlanner)
Expand Down
Loading
Loading