Fixed da tests
This commit is contained in:
parent
e43fbd2888
commit
ba5803d756
2 changed files with 10 additions and 10 deletions
|
|
@ -59,19 +59,19 @@ defmodule PinchflatWeb.Sources.SourceLive.IndexTableLiveTest do
|
||||||
end
|
end
|
||||||
|
|
||||||
test "clicking a different row will sort by that attribute", %{conn: conn} do
|
test "clicking a different row will sort by that attribute", %{conn: conn} do
|
||||||
source1 = source_fixture(custom_name: "Source_A", retention_period_days: 10)
|
source1 = source_fixture(custom_name: "Source_A", enabled: true)
|
||||||
source2 = source_fixture(custom_name: "Source_A", retention_period_days: 5)
|
source2 = source_fixture(custom_name: "Source_A", enabled: false)
|
||||||
|
|
||||||
{:ok, view, _html} = live_isolated(conn, IndexTableLive, session: create_session())
|
{:ok, view, _html} = live_isolated(conn, IndexTableLive, session: create_session())
|
||||||
|
|
||||||
# Click the row to change the sort field
|
# 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:first-child") =~ source2.custom_name
|
||||||
assert render_element(view, "tbody tr:last-child") =~ source1.custom_name
|
assert render_element(view, "tbody tr:last-child") =~ source1.custom_name
|
||||||
|
|
||||||
# Click the row to again change the sort direcation
|
# 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:first-child") =~ source1.custom_name
|
||||||
assert render_element(view, "tbody tr:last-child") =~ source2.custom_name
|
assert render_element(view, "tbody tr:last-child") =~ source2.custom_name
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue