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

The DOM by Karma rendered is not the same as the DOM by Angular rendered #3700

Closed
leochen0818 opened this issue Sep 22, 2021 · 3 comments
Closed

Comments

@leochen0818
Copy link

I wrote a test case to test the form that I make with Angular Template Driven Forms, but it failed because the DOM by Karma rendered is not the same as the DOM by Angular rendered.

These are the captures:

testing result

testing result

testing result

The background one was running by Angular, another one was running by Karma.

Here is the sample code: https://github.com/leochen0818/angular-30days-form-and-testing/blob/fcc478d2191710c9bd5374d46ceeb785e5562993/src/app/app.component.spec.ts#L304-L309

@devoto13
Copy link
Collaborator

Thanks for the report!

I do observe the same problem and it does look wrong to me. I'm not sure what's causing it though. However, the problem seems to be either in Angular itself or the Angular plugin for karma which is provided as part of Angular CLI. What karma core does is that it just loads your tests into browser, runs them, and displays the result and I don't think this issue is caused by the bug in karma core (I may be wrong of course).

I think you will have a better chance of getting help either in Angular support channels or Angular CLI support channels. Please post back here if you manage to figure out what is causing this problem.

@leochen0818
Copy link
Author

Thanks for the report!

I do observe the same problem and it does look wrong to me. I'm not sure what's causing it though. However, the problem seems to be either in Angular itself or the Angular plugin for karma which is provided as part of Angular CLI. What karma core does is that it just loads your tests into browser, runs them, and displays the result and I don't think this issue is caused by the bug in karma core (I may be wrong of course).

I think you will have a better chance of getting help either in Angular support channels or Angular CLI support channels. Please post back here if you manage to figure out what is causing this problem.

Thank you for your reply. I submit the issue to Angular CLI support channels.

The link is: https://github.com/angular/angular-cli/issues/21803

Maybe we can found the cause there.

@devoto13
Copy link
Collaborator

I'm going to close this issue in favour of https://github.com/angular/angular-cli/issues/21803 as it seems to be bug in Angular and in its current state there is nothing we can do about it in the karma repo.

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

2 participants