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

187
Views
@open-wc/testing - TypeError: no se pueden establecer propiedades de indefinido (configuración 'oculta')

Estoy ejecutando una prueba unitaria en un componente web que se ha creado con lit. La prueba está fallando al presionar la función firstUpdated() . El problema parece estar relacionado con this.tooltip.hidden y la información sobre tooltip no está definida.

El código en sí funciona como se esperaba y muestra/oculta el elemento; sin embargo, cuando se ejecuta la prueba unitaria, no se ve el elemento de información sobre tooltip .

¿Alguien tiene alguna idea?

Código de componente:

 @query('.tooltip') tooltip: HTMLElement; firstUpdated() { this.tooltip.hidden = !this.open; }

Código de prueba de la unidad:

 it('should render its children', async () => { const content = 'Content' const el = await fixture<Tooltip>(html`<qg-tooltip>${content}</qg-tooltip>`) expect(el).to.contain.html(content) });

Error recibido:

 TypeError: Cannot set properties of undefined (setting 'hidden') at Tooltip.firstUpdated (src/components/tooltip/Tooltip.ts:63:17) at Tooltip._$AE (../../node_modules/@lit/reactive-element/src/reactive-element.ts:1350:11) at Tooltip.performUpdate (../../node_modules/@lit/reactive-element/src/reactive-element.ts:1317:11) at Tooltip.scheduleUpdate (../../node_modules/@lit/reactive-element/src/reactive-element.ts:1235:16) at Tooltip._$E_ (../../node_modules/@lit/reactive-element/src/reactive-element.ts:1207:24) at async elementUpdated (../../node_modules/@open-wc/testing-helpers/src/elementUpdated.js:24:5) at async litFixture (../../node_modules/@open-wc/testing-helpers/src/litFixture.js:63:3)
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!