1

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

https://www.cypress.io/blog/2017/11/28/testing-vue-web-application-with-vuex-data-store-and-rest-backend/

but I don't even want to touch the store. Is this possible?

1 Answer 1

1

Havent tested this but it should go like this:

        cy.stub(YourComponent.computed, 'isAdmin').callsFake(() => { return true })
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.