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

  1. choptastic commented on Jan 5, 2023

    @choptastic
    Member
  2. fnchooft commented on Jan 5, 2023

    @fnchooft
    Author

    Hi Jesse, happy new year!
    I will check the rebar3-branch.

    Follow up question: Is there a timeline for this rebar3-transformation? :)

    No hurries - but if so that would be great news!

    Especially thinking about dependency mgmt - for instance jquery- jmobile, fileupload etc - maybe there is a way to make it a bit more configurable.

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