@HostBinding('attr.id') with dynamic attribute during testing conflicting Karma logic #35215
Labels
area: testing
Issues related to Angular testing features, such as TestBed
freq1: low
P3
An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
type: bug/fix
Milestone
馃悶 bug report
Affected Package
The issue is caused by package @angular/core, @angular/core/testing
Is this a regression?
No
Description
Creating elements that bind to the id attribute of their host from an input causes Karma to display all previously tested elements instead of clearing after each spec.
It seems the issue occurs when the property that is bound is set programmatically during the tests.
馃敩 Minimal Reproduction
https://github.com/hodossy/ng-hostbinding-id-test-issue
馃敟 Exception or Error
As it can be seen, multiple test elements are left behind, probably because Karma clears the elements by ID.
My expactation would be that Karma removes the previous tested element and only the last one is visible after the test suite is run.
馃實 Your Environment
Angular Version:
Anything else relevant?
I had no time to test with other browsers than Chrome, but I think it should not be specific to Chrome
The text was updated successfully, but these errors were encountered: