Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

245
Views
Jest Vuex TypeError: no se pueden leer las propiedades de undefined (leyendo 'estado')

Estoy usando Quasar, vue y vuex. Creé un diseño y me gustaría usar jest para la prueba unitaria. He estado copiando fragmentos de mi código de diseño y ejecutando pruebas a medida que avanzo.

Este es mi código de especificación

 import MainLayout from "../../../src/layouts/test"; import { mountFactory } from "@quasar/quasar-app-extension-testing-unit-jest"; import { QLayout, QHeader, QToolbar, QBtn, QToolbarTitle, QImg } from "quasar"; const factory = mountFactory(MainLayout, { mount: { type: "full" }, quasar: { components: { QLayout, QHeader, QToolbar, QBtn, QToolbarTitle, QImg }, }, }); describe("test", () => { it("Show leftdrawer if leftDrawer is true", async () => { const wrapper = factory(MainLayout); await wrapper.vm.$nextTick(); expect(wrapper.findComponent("button").isVisible()).toBe(true); }); }); When I add this part in my MainLayout.vue <div v-if="!isAuthenticated"> <q-btn @click="goTo('signin')" outline roundeded label="sign in" name="signin" class="q-mr-sm" >

y esta parte

 computed: { ...mapState("member", { isAuthenticated: (state: MemberState) => state.isAuthenticated, })

},

Recibo este error al probar TypeError: no se pueden leer las propiedades de undefined (leyendo 'estado')

 ...mapState("member", { isAuthenticated: (state: MemberState) => state.isAuthenticated, })

¿Cómo configuro mi archivo de especificaciones para que se lea isAuthenticated from state in store?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!