File tree Expand file tree Collapse file tree 4 files changed +57
-0
lines changed Expand file tree Collapse file tree 4 files changed +57
-0
lines changed Original file line number Diff line number Diff line change @@ -42,8 +42,11 @@ A `Wrapper` is an object that contains a mounted component or vnode and methods
4242!!!include(docs/api/wrapper/isVueInstance.md)!!!
4343!!!include(docs/api/wrapper/name.md)!!!
4444!!!include(docs/api/wrapper/props.md)!!!
45+ !!!include(docs/api/wrapper/setChecked.md)!!!
4546!!!include(docs/api/wrapper/setData.md)!!!
4647!!!include(docs/api/wrapper/setMethods.md)!!!
4748!!!include(docs/api/wrapper/setProps.md)!!!
49+ !!!include(docs/api/wrapper/setSelected.md)!!!
50+ !!!include(docs/api/wrapper/setValue.md)!!!
4851!!!include(docs/api/wrapper/text.md)!!!
4952!!!include(docs/api/wrapper/trigger.md)!!!
Original file line number Diff line number Diff line change 1+ ## setChecked(value)
2+
3+ Sets the value of a radio or checkbox ` <input ` >.
4+
5+ - ** Arguments:**
6+ - ` {Boolean} selected `
7+
8+ - ** Example:**
9+
10+ ``` js
11+ import { mount } from ' @vue/test-utils'
12+ import Foo from ' ./Foo.vue'
13+
14+ const wrapper = mount (Foo)
15+ const option = wrapper .find (' input[type="radio"]' )
16+ option .setChecked ()
17+ ```
18+
Original file line number Diff line number Diff line change 1+ ## setSelected(value)
2+
3+ Sets a specified ` <option> ` as selected in a ` <select> ` .
4+
5+ - ** Arguments:**
6+ - ` {Boolean} selected `
7+
8+ - ** Example:**
9+
10+ ``` js
11+ import { mount } from ' @vue/test-utils'
12+ import Foo from ' ./Foo.vue'
13+
14+ const wrapper = shallowMount (Foo)
15+ const options = wrapper .find (' select' ).findAll (' option' )
16+
17+ options .at (1 ).setSelected ()
18+ expect (wrapper .text ()).to .contain (' option1' )
19+ ```
Original file line number Diff line number Diff line change 1+ ## setValue(value)
2+
3+ Sets the value of a text ` <input> ` .
4+
5+ - ** Arguments:**
6+ - ` {String} value `
7+
8+ - ** Example:**
9+
10+ ``` js
11+ import { mount } from ' @vue/test-utils'
12+ import Foo from ' ./Foo.vue'
13+
14+ const wrapper = mount (Foo)
15+ const input = wrapper .find (' input[type="text"]' )
16+ input .setValue (' some value' )
17+ ```
You can’t perform that action at this time.
0 commit comments