test(common): fix double instantiation in NgSwitch test (#25632)
One of the tests was creating TestComponent instance _and_ using global state making this test not predictable. Fixing the test by making sure that TestComponent is instantiated only once. PR Close #25632
This commit is contained in:
parent
f596930c8c
commit
3634575d89
|
@ -133,9 +133,7 @@ import {expect} from '@angular/platform-browser/testing/src/matchers';
|
|||
'</div>';
|
||||
|
||||
TestBed.configureTestingModule({declarations: [TestDirective]});
|
||||
TestBed.overrideComponent(TestComponent, {set: {template: template}})
|
||||
.createComponent(TestComponent);
|
||||
const fixture = TestBed.createComponent(TestComponent);
|
||||
const fixture = createTestComponent(template);
|
||||
fixture.componentInstance.switchValue = 'a';
|
||||
|
||||
fixture.detectChanges();
|
||||
|
|
Loading…
Reference in New Issue