-
Notifications
You must be signed in to change notification settings - Fork 671
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bcad00b
commit 87936e9
Showing
10 changed files
with
67 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
## setChecked(value) | ||
|
||
设置一个 `<input>` 单选框或复选框的值。 | ||
|
||
- **参数:** | ||
- `{Boolean} selected` | ||
|
||
- **示例:** | ||
|
||
```js | ||
import { mount } from '@vue/test-utils' | ||
import Foo from './Foo.vue' | ||
|
||
const wrapper = mount(Foo) | ||
const option = wrapper.find('input[type="radio"]') | ||
option.setChecked() | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
## setSelected(value) | ||
|
||
在一个 `<select>` 中选中某个特定的 `<option>`。 | ||
|
||
- **参数:** | ||
- `{Boolean} selected` | ||
|
||
- **示例:** | ||
|
||
```js | ||
import { mount } from '@vue/test-utils' | ||
import Foo from './Foo.vue' | ||
|
||
const wrapper = shallowMount(Foo) | ||
const options = wrapper.find('select').findAll('option') | ||
|
||
options.at(1).setSelected() | ||
expect(wrapper.text()).to.contain('option1') | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
## setValue(value) | ||
|
||
设置一个 `<input>` 文本的值。 | ||
|
||
- **参数:** | ||
- `{String} value` | ||
|
||
- **示例:** | ||
|
||
```js | ||
import { mount } from '@vue/test-utils' | ||
import Foo from './Foo.vue' | ||
|
||
const wrapper = mount(Foo) | ||
const input = wrapper.find('input[type="text"]') | ||
input.setValue('some value') | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters