From ba5803d7561556de0e1d2f75a1bc1f366c6684dd Mon Sep 17 00:00:00 2001 From: Kieran Eglin Date: Fri, 13 Dec 2024 09:37:39 -0800 Subject: [PATCH] Fixed da tests --- .../components/custom_components/table_components.ex | 12 ++++++------ .../controllers/sources/index_table_live_test.exs | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/pinchflat_web/components/custom_components/table_components.ex b/lib/pinchflat_web/components/custom_components/table_components.ex index 6ad1502..106c45a 100644 --- a/lib/pinchflat_web/components/custom_components/table_components.ex +++ b/lib/pinchflat_web/components/custom_components/table_components.ex @@ -41,12 +41,12 @@ defmodule PinchflatWeb.CustomComponents.TableComponents do phx-value-sort_key={col[:sort_key]} >
- {col[:label]} - <.icon - :if={to_string(@sort_key) == col[:sort_key]} - name={if @sort_direction == :asc, do: "hero-chevron-up", else: "hero-chevron-down"} - class="w-3 h-3 mt-2 ml-1 absolute" - /> + {col[:label]} + <.icon + :if={to_string(@sort_key) == col[:sort_key]} + name={if @sort_direction == :asc, do: "hero-chevron-up", else: "hero-chevron-down"} + class="w-3 h-3 mt-2 ml-1 absolute" + />
diff --git a/test/pinchflat_web/controllers/sources/index_table_live_test.exs b/test/pinchflat_web/controllers/sources/index_table_live_test.exs index 51e68f4..675e47d 100644 --- a/test/pinchflat_web/controllers/sources/index_table_live_test.exs +++ b/test/pinchflat_web/controllers/sources/index_table_live_test.exs @@ -59,19 +59,19 @@ defmodule PinchflatWeb.Sources.SourceLive.IndexTableLiveTest do end test "clicking a different row will sort by that attribute", %{conn: conn} do - source1 = source_fixture(custom_name: "Source_A", retention_period_days: 10) - source2 = source_fixture(custom_name: "Source_A", retention_period_days: 5) + source1 = source_fixture(custom_name: "Source_A", enabled: true) + source2 = source_fixture(custom_name: "Source_A", enabled: false) {:ok, view, _html} = live_isolated(conn, IndexTableLive, session: create_session()) # Click the row to change the sort field - click_element(view, "th", "Retention") + click_element(view, "th", "Enabled?") assert render_element(view, "tbody tr:first-child") =~ source2.custom_name assert render_element(view, "tbody tr:last-child") =~ source1.custom_name # Click the row to again change the sort direcation - click_element(view, "th", "Retention") + click_element(view, "th", "Enabled?") assert render_element(view, "tbody tr:first-child") =~ source1.custom_name assert render_element(view, "tbody tr:last-child") =~ source2.custom_name end