Skip to content

Commit eee39ba

Browse files
committed
Testing v-model section
1 parent ebad70f commit eee39ba

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1581,7 +1581,7 @@ And everything works fine again.
15811581

15821582
## Testing v-model
15831583

1584-
Let's test a custom component with `v-model` support, e.g. like this one:
1584+
Let's test a custom component with `v-model` support, like this one:
15851585

15861586
```html
15871587
<div class="c-checkbox">
@@ -1627,7 +1627,7 @@ We can use this component in any form:
16271627
<my-checkbox v-model="value"></my-checkbox>
16281628
```
16291629

1630-
If the component doesn't have `v-model` we can do all test just using `mount(MyCheckbox, { ... })`, but unfortunately, the component supports `v-model` and there is no way how model can be passed to the `mount()`. What we have to do is to create another component which uses the component under the test inside its template. The wrapper can also provide a value which will be passed to the v-model and which will be updated:
1630+
If the component doesn't have `v-model`, we can test it using: `mount(MyCheckbox, { ... })`. Unfortunately, the component supports `v-model` and there is no way to pass in the model through `mount()`. What we have to do is to create another component which uses the component under the test inside its template. The wrapper can provide a value to pass in the `v-model` value, which will be updated as expected:
16311631

16321632
```js
16331633
beforeEach(function () {

0 commit comments

Comments
 (0)