early-toddler-97363
05/07/2022, 11:23 AMearly-toddler-97363
05/13/2022, 6:08 AMwonderful-match-15836
05/13/2022, 2:52 PMwonderful-match-15836
05/13/2022, 3:05 PM@cypress/vue
you are working with, and whether using propsData
vs props
behaves any differently: https://v1.test-utils.vuejs.org/api/options.html#propsdata
I'm actually rusty on the non-JSX mounting syntax at this point but I know that updating the value of a prop after mounting a component does work and we do it a lot.nutritious-glass-59704
05/30/2022, 4:08 PMwonderful-match-15836
05/31/2022, 2:08 PMit('shows new value of a prop', () => {
const name = ref('hello test')
cy.mount(TestComponent, {
props: {
name,
},
})
cy.contains('hello test').then(() => {
name.value = 'new test'
cy.contains('new test') // passes
})
})
nutritious-glass-59704
06/08/2022, 3:19 PMnpm init vue@latest
and selecting cypress, typescript, and nothing else
I then created a cypress test for the included demo component WelcomeItem
I added one property.
The test and it is already failing. with the message 'Cannot convert undefined or null to object'
The component works as expected in the app. It only fails in the test
Can you please take a look at it? It is super simple.
https://github.com/jewpaltz/cypress_component_testing/commit/f4c1d34e1aa6fa1c2d4b63efec111728c3891317
I am going to crosspost this with the main thread of the channel to see if anyone else can spot what is going on. Please respond there if you get a chance