How to check v-model update? #28454
Unanswered
T0miii
asked this question in
Component Testing
Replies: 2 comments 1 reply
-
I also ran into this problem. Does anyone know how update v-model? |
Beta Was this translation helpful? Give feedback.
0 replies
-
JSX was the only way we could make it work, Should be probably better described in the docs tho. import CheckboxComponent from './CheckboxComponent.vue'
import {ref} from "vue";
describe('<CheckboxComponent />', () => {
it('renders', () => {
// see: https://on.cypress.io/mounting-vue
const model = ref<unknown[]>([])
cy.mount(() => (
<CheckboxComponent v-model={model.value} label="Check This Item"/>
))
})
}) |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a rather simpe Vue 3 Select Component
I click the input , dropdown opens, i click label value gets emited trough modelValue (v-model), new option is shown as selected.
How can i test this with cypress component tests
it mounts with the value 3 selected, but when the test opens the dropdown and click on another option the selected does not get updated.
Beta Was this translation helpful? Give feedback.
All reactions