No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Please, help with two-way binding test for QInput (Quasar 16, Jest, Vue)

    Help
    1
    2
    512
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      Mike last edited by

      Guys, can you, please advise what could be done here.

      I have the following component I’d like to test (not as shallow)

      0_1531906167328_5bd886eb-3b71-4a3c-bd82-78856a95eb4b-image.png

      I wanted to perform here the following tests:

      • verify the event is emitted when I set the this.selectedValue (so to tests watcher)
      • verify that this.selectedValue is changed to the value entered in embedded Qinput - as if some user enters something and manipulates the v-model.

      I managed to write the first one but I’m really struggling with the second one.

      0_1531906422643_1e95356c-e47d-4b91-9c35-168aaa603765-image.png

      I triggered a lot of different events but vm.vm.selectedValue just remained as it was recieved from props.

      Can you please, give any insights how to see the selectedValue finally changed? (I also tried $nextTick but no luck)

      Thank you in advance!

      1 Reply Last reply Reply Quote 0
      • M
        Mike last edited by

        Sorry, the implementation of ‘@vue/test-utils’ specifies.
        input.element.value = ‘other’
        input.trigger(‘input’)

        This seems to work.

        1 Reply Last reply Reply Quote 0
        • First post
          Last post