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:
Pawel Kozlowski 2018-08-23 12:45:39 +02:00 committed by Matias Niemelä
parent f596930c8c
commit 3634575d89
1 changed files with 1 additions and 3 deletions

View File

@ -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();