test(platform-browser): complete component bootstrap before switching to the next test (#43933)

The bootstrap tests that reused the same component (the `HelloRootCmp` one) were randomly failing due to the incomplete cleanup between tests. This commit ensures that the component bootstrap is fully cimpleted and there are no pending async actions before going to the next test.

PR Close #43933
This commit is contained in:
Andrew Kushnir 2021-10-23 12:46:07 -07:00 committed by Jessica Janiuk
parent 6e37c938e2
commit bf1a2fc2d5

View file

@ -272,9 +272,10 @@ function bootstrap(
});
}
it('should create an injector promise', () => {
it('should create an injector promise', async () => {
const refPromise = bootstrap(HelloRootCmp, testProviders);
expect(refPromise).toEqual(jasmine.any(Promise));
await refPromise; // complete component initialization before switching to the next test
});
it('should set platform name to browser', done => {