Skip to content

expected output from wf:qs -> [] vs [[]] #15

Description

@fnchooft

Hi, I was running the "make test" target to see if a change I made was passing.

However I found that the test for multidropdownblank was failing.
The function returns [[]] instead of the expected [].

 test_multidropdownblank() ->
     {
         fun() -> wf:set_multiple(multiple, []) end,
-        fun() -> wf:qs(multiple) == [] end
+        fun() -> wf:qs(multiple) == [[]] end
     }.

https://github.com/nitrogen/NitrogenProject.com/blob/master/src/tests/tests_simplecontrols.erl#L75

The question now becomes - what is wf:qs supposed to return if there is no result?

It seems that:

  • if the element with id=multiple is ON screen - and data is selected ( "1","3" ) - it returns ["1","3"]
  • if the element with id=multiple is NOT ON screen - it returns []
  • if the element with id=multiple is ON screen - without any selection - it returns [[]]

Could you confirm my understanding?

Kind regards,

Fabian

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions