From d8007572d41bd825196a52abdcf467bd30b4630d Mon Sep 17 00:00:00 2001 From: Max Marcon Date: Thu, 26 Dec 2024 14:52:41 +0100 Subject: [PATCH] also cover navigating options upwards in quick_tags mode --- test/live_select_quick_tags_test.exs | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/test/live_select_quick_tags_test.exs b/test/live_select_quick_tags_test.exs index 1e7b71e..d3b8157 100644 --- a/test/live_select_quick_tags_test.exs +++ b/test/live_select_quick_tags_test.exs @@ -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)