Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't unit test the player component. Can't set properties of undefined (setting 'src') when the player is added to the app component #142

Open
vladyn opened this issue Mar 19, 2024 · 0 comments

Comments

@vladyn
Copy link

vladyn commented Mar 19, 2024

Description

Can't unit test a component contains ngx-videogular

Expected Behavior

I have a simple player exactly created as per docs. I Expect when I add the component to the app component view my unit tests not to brake.

Actual Behavior

Unit tests are broken with an eroor

ERROR: 'Error during cleanup of component', Object{component: AppComponent{title: 'm3-learning-hub', __ngContext__: 0}, stacktrace: TypeError: Cannot set properties of undefined (setting 'src')
TypeError: Cannot set properties of undefined (setting 'src')
    at VgMediaDirective.call [as ngOnDestroy] (http://localhost:9876/_karma_webpack_/webpack:/node_modules/@videogular/ngx-videogular/fesm2022/videogular-ngx-videogular-core.mjs:944:25)
    at executeOnDestroys (http://localhost:9876/_karma_webpack_/webpack:/node_modules/@angular/core/fesm2022/core.mjs:9960:32)
    at cleanUpView (http://localhost:9876/_karma_webpack_/webpack:/node_modules/@angular/core/fesm2022/core.mjs:9863:9)
    at destroyViewTree (http://localhost:9876/_karma_webpack_/webpack:/node_modules/@angular/core/fesm2022/core.mjs:9698:17)
    at destroyLView (http://localhost:9876/_karma_webpack_/webpack:/node_modules/@angular/core/fesm2022/core.mjs:9836:9)
    at ViewRef$1.destroy (http://localhost:9876/_karma_webpack_/webpack:/node_modules/@angular/core/fesm2022/core.mjs:12672:9)
    at ComponentRef.destroy (http://localhost:9876/_karma_webpack_/webpack:/node_modules/@angular/core/fesm2022/core.mjs:15462:23)
    at PseudoApplicationComponentFixture.destroy (http://localhost:9876/_karma_webpack_/webpack:/node_modules/@angular/core/fesm2022/testing.mjs:243:31)
    at PseudoApplicationComponentFixture.destroy (http://localhost:9876/_karma_webpack_/webpack:/node_modules/@angular/core/fesm2022/testing.mjs:388:15)

Steps to Reproduce

If this is an issue, describe the steps you took to see the issue. If this is a feature, delete this block.

  1. create simple videogular player from as per the docs
  2. add it to the app component e.g. -
  3. tests for the app component always fails with the above error

Em I doing something wrong here or this is known issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant