Skip to content

Commit

Permalink
also cover navigating options upwards in quick_tags mode
Browse files Browse the repository at this point in the history
  • Loading branch information
maxmarcon committed Dec 26, 2024
1 parent 08ec29f commit d800757
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions test/live_select_quick_tags_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -25,26 +25,23 @@ defmodule LiveSelectQuickTagsTest do
assert_selected_multiple(live, ~w(B D))
end

test "already selected options are selectable in the dropdown using keyboard", %{live: live} do
test "already selected options can be deselected in the dropdown using keyboard", %{live: live} do
stub_options(~w(A B C D))

type(live, "ABC")

select_nth_option(live, 2)
assert_selected_multiple(live, ~w(B))

type(live, "ABC")
navigate(live, 2, :down)
keydown(live, "Enter")

assert_selected_multiple(live, ~w())
navigate(live, 3, :down)
navigate(live, 1, :up)

type(live, "ABC")
navigate(live, 10, :down)
navigate(live, 10, :up)
keydown(live, "Enter")
assert_selected_multiple(live, ~w())
end

test "already selected options are selectable in the dropdown using mouseclick", %{
test "already selected options can be deselected in the dropdown using mouseclick", %{
live: live
} do
select_and_open_dropdown(live, 2)
Expand Down

0 comments on commit d800757

Please sign in to comment.