Skip to content

Commit

Permalink
Merge pull request #1742 from MushroomObserver/nimmo-no-turbo-frame-n…
Browse files Browse the repository at this point in the history
…aming

Convert `#observation_namings` to a `div` (from a `turbo-frame`)
  • Loading branch information
JoeCohen committed Dec 23, 2023
2 parents 9f740b4 + 122c13c commit 5c09295
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 9 deletions.
2 changes: 1 addition & 1 deletion app/views/observations/namings/index.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<%=
tag.turbo_frame(id: "observation_namings") do
tag.div(id: "observation_namings") do
render(partial: "observations/namings/table",
locals: { obs: @observation })
end %>
8 changes: 1 addition & 7 deletions app/views/observations/show/_namings.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,7 @@
%>

<!--OBSERVATION_NAMINGS / TABLE REFRESHED BY TURBO -->
<%= tag.turbo_frame(
id: "observation_namings",
# src: observation_namings_path(observation_id: obs.id),
# loading: "lazy"
# for lazy loading, don't put anything in the block.
) do

<%= tag.div(id: "observation_namings") do
render(partial: "observations/namings/table",
locals: { obs: obs, query: @query })
end %>
Expand Down
19 changes: 18 additions & 1 deletion test/system/observation_show_system_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ def test_add_and_edit_naming_and_comment
assert_selector("#title", text: /#{nam.text_name}/)
# sleep(3)

# check that there is a vote tally with this naming
# check that there is a vote "index" tally with this naming
within("#observation_namings") do
assert_link(href: "/observations/#{obs.id}/namings/#{nam.id}/votes")
click_link(href: "/observations/#{obs.id}/namings/#{nam.id}/votes")
Expand All @@ -314,6 +314,23 @@ def test_add_and_edit_naming_and_comment
end
assert_no_selector("#modal_naming_votes_#{nam.id}")

# Test the link to the naming name and user
within("#observation_namings") do
assert_link(text: /#{n_d.text_name}/)
click_link(text: /#{n_d.text_name}/)
end
assert_selector("body.names__show", wait: 15)
page.go_back

# Test the link to the naming user... whoa, this takes too long!
# Re-add this test when the user page is sped up.
# within("#observation_namings") do
# assert_link(text: /#{rolf.login}/)
# click(text: /#{rolf.login}/)
# end
# assert_selector("body.users__show", wait: 30)
# page.go_back

# Test the edit naming form link.
within("#observation_namings") do
assert_link(text: /#{n_d.text_name}/)
Expand Down

0 comments on commit 5c09295

Please sign in to comment.