diff --git a/lib/wallaby/browser.ex b/lib/wallaby/browser.ex index dac8272b..bbdb4529 100644 --- a/lib/wallaby/browser.ex +++ b/lib/wallaby/browser.ex @@ -1393,7 +1393,7 @@ defmodule Wallaby.Browser do defp validate_html(parent, %{html_validation: :button_type} = query) do buttons = all(parent, Query.css("button", text: query.selector)) - if Enum.count(buttons) == 1 && Enum.any?(buttons) do + if Enum.count(buttons) == 1 do {:error, :button_with_bad_type} else {:ok, query} diff --git a/lib/wallaby/query.ex b/lib/wallaby/query.ex index 401036b0..1c996d3c 100644 --- a/lib/wallaby/query.ex +++ b/lib/wallaby/query.ex @@ -502,11 +502,11 @@ defmodule Wallaby.Query do defp build_conditions(opts) do opts - |> add_visibility - |> add_text - |> add_count - |> add_selected - |> add_at + |> add_visibility() + |> add_text() + |> add_count() + |> add_selected() + |> add_at() end defp add_visibility(opts) do @@ -526,9 +526,9 @@ defmodule Wallaby.Query do Keyword.put(opts, :count, 1) else opts - |> Keyword.put_new(:count, opts[:count]) - |> Keyword.put_new(:minimum, opts[:minimum]) - |> Keyword.put_new(:maximum, opts[:maximum]) + |> Keyword.put_new(:count, nil) + |> Keyword.put_new(:minimum, nil) + |> Keyword.put_new(:maximum, nil) end end