Capybara integration tests with jquery.selectize

后端 未结 5 1934
隐瞒了意图╮
隐瞒了意图╮ 2021-01-17 17:49

How can I write a capybara integration test with a form using jquery.selectize?

I\'d like to test a user entering a couple of values.

5条回答
  •  抹茶落季
    2021-01-17 18:39

    The API allows it but the options need to be added first before the value can be set:

    var selectize = $('.selector')[0].selectize
    selectize.addOptions([{text: 'Hello', value: 'Hello'}, {text: 'World', value: 'World'}])
    selectize.setValue(['Hello', 'World'])
    

提交回复
热议问题