germsvel / phoenix_test

PhoenixTest provides a unified way of writing feature tests -- regardless of whether you're testing LiveView pages or static (non-LiveView) pages.
https://hex.pm/packages/phoenix_test
MIT License
181 stars 23 forks source link

Improve test: Add '[]' suffix to multi-select name attr #90

Closed ftes closed 4 months ago

ftes commented 5 months ago

Extracted from #74

Align PageView with IndexLive: <select multiple> should use name attr ending in [].

Even though the tests do not currently fail (decode multiple values), an actual Phoenix app would fail (decode only a single value).

As a follow-up, it might be good to make the Static driver stricter to emulate real-world behaviour.

https://github.com/elixir-plug/plug/blob/v1.16.0/lib/plug/parsers/urlencoded.ex https://github.com/elixir-plug/plug/blob/v1.16.0/lib/plug/conn/query.ex#L24

  Lists are created with `[]`:

      iex> decode("foo[]=bar&foo[]=baz")["foo"]
      ["bar", "baz"]
ftes commented 5 months ago

Somewhat related to #77, #79

germsvel commented 4 months ago

@ftes I'm going to close this since I think it's fixed by #94 (right?). If it's not, happy to reopen it.