vuejs / vue-test-utils

Component Test Utils for Vue 2
https://vue-test-utils.vuejs.org
MIT License
3.57k stars 668 forks source link

wrapper.setChecked(true) sets radioButton.selected = true not radioButton.checked = true #1930

Open THEPR9FESS9R opened 3 years ago

THEPR9FESS9R commented 3 years ago

Version

1.3.0

Reproduction link

github.com

Steps to reproduce

Switch to node version 14.15.1 -> run npm i -> run npm test

What is expected?

tests should pass

What is actually happening?

tests are failing


https://github.com/vuejs/vue-test-utils/blob/106070827131ce0319108b5f7ca8236829384878/packages/test-utils/src/wrapper.js#L600

should set " this.element.checked = true" not "this.element.selected = true"

chaishi commented 3 years ago
const radioInput = wrapper.find('input[type="radio"]');
await radioInput.setChecked();
expect(radioInput.element.checked).toBeTruthy();

this test should be pass, instead of failling