Reputation: 1043
I am trying to stub this out in Cypress. I have a computed that returns true or false. I just want it to return true.
computed: {
isAdmin() {
return this.$store.state.User.isRegistered &&
this.$store.state.User.isAdmin
}
}
There is a great article on using the vuex store
but I don't even want to touch the store. Is this possible?
Upvotes: 1
Views: 1004
Reputation: 12945
Havent tested this but it should go like this:
cy.stub(YourComponent.computed, 'isAdmin').callsFake(() => { return true })
Upvotes: 1