Add setChecked and setValue methods
See original GitHub issueWhat problem does this feature solve?
Changing the value so that the v-model is updated can be confusing:
const input = wrapper.find('input[type="text"]')
input.element.value = 'some value' // input element value is changed, v-model is not
input.trigger('input') // v-model updated
const radioInput = wrapper.find('input[type="radio"]')
radioInput.element.checked = true // input element value is changed, v-model is not
radioInput.trigger('input') // v-model not updated
radioInput.trigger('change') // v-model updated
What does the proposed API look like?
const input = wrapper.find('input[type="text"]')
input.setValue('some value')
const radioInput = wrapper.find('input[type="radio"]')
radioInput.setChecked()
const option = wrapper.find('option')
option.setSelected()
Issue Analytics
- State:
- Created 5 years ago
- Reactions:11
- Comments:7 (6 by maintainers)
Top Results From Across the Web
com.vaadin.v7.ui.CheckBox.setValue java code examples
How to use. setValue. method. in. com.vaadin.v7.ui.CheckBox ... setValue(true); m_selectedCheckboxes.add((Integer)button.getData()); } }.
Read more >Change Checkbox value without triggering onCheckChanged
The onCheckedChanged method is called directly from setChecked . What you can do is the following: mCheck.setOnCheckedChangeListener (null); mCheck.
Read more >PyQt5 - setChecked() method for Check Box - GeeksforGeeks
setChecked method is used to change the state of check box. By default it is un-checked after clicking on the check box widget...
Read more >Wrapper | Vue Test Utils
Vue Test Utils is a wrapper based API. A Wrapper is an object that contains a mounted component or vnode and methods to...
Read more >RadioButtonList - How to add a text box to a selected item's ...
To check the required RadioButton in this scenario on the client side, you can use the SetValue method instead of SetChecked and call...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi, you should take a look to mwangaben-vthelpers which provides some helpers for vue-test-utils like b.type(text, selector) :
@beyersito I’m not currently working on it, it would be great if you could 😃