You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are using video.js and are pragmatically "hiding" elements if a condition passes. Apparently, one of the classes is not visible by the test suite.
Steps to reproduce
create a video component with this as the logic
<template><videoref="video"class="video-js vjs-big-play-centered"playsinline/></template><scriptlang="ts">
@Ref('video')video!: HTMLVideoElementmounted(){this.player=videojs(this.video)consthtmlPlayer=(this.playerasany).el_htmlPlayer.getElementsByClassName('vjs-progress-control')[0].style.visibility='hidden'// this line will throwhtmlPlayer.getElementsByClassName('vjs-picture-in-picture-control')[0].style.display='none'}</script>
shallowMount the component in a unit test
Expected behaviour
The element should be visible in the test suite
Actual behaviour
When using wrapper.html() the element with that classname does not exist
in addition the test fails with this error
TypeError: Cannot read property 'style' of undefined
138 | /* istanbul ignore next */
139 | if (this.disablePip === 'true') {
> 140 | htmlPlayer.getElementsByClassName('vjs-picture-in-picture-control')[0].style.display = 'none'
| ^
141 | }
Possible Solution
I tried creating the element with that specified classname, but was unseccessful
The text was updated successfully, but these errors were encountered:
Missing elements from wrapper
We are using video.js and are pragmatically "hiding" elements if a condition passes. Apparently, one of the classes is not visible by the test suite.
Steps to reproduce
create a video component with this as the logic
shallowMount the component in a unit test
Expected behaviour
The element should be visible in the test suite
Actual behaviour
When using
wrapper.html()
the element with that classname does not existin addition the test fails with this error
Possible Solution
I tried creating the element with that specified classname, but was unseccessful
The text was updated successfully, but these errors were encountered: