|
1 | 1 | import {
|
| 2 | + ApplicationInitStatus, |
2 | 3 | ChangeDetectorRef,
|
3 | 4 | Component,
|
4 |
| - Type, |
| 5 | + isStandalone, |
5 | 6 | NgZone,
|
6 |
| - SimpleChange, |
7 | 7 | OnChanges,
|
| 8 | + SimpleChange, |
8 | 9 | SimpleChanges,
|
9 |
| - ApplicationInitStatus, |
10 |
| - isStandalone, |
| 10 | + Type, |
11 | 11 | } from '@angular/core';
|
12 |
| -import { ComponentFixture, DeferBlockState, TestBed, tick } from '@angular/core/testing'; |
13 |
| -import { BrowserAnimationsModule, NoopAnimationsModule } from '@angular/platform-browser/animations'; |
14 |
| -import { NavigationExtras, Router } from '@angular/router'; |
15 |
| -import { RouterTestingModule } from '@angular/router/testing'; |
| 12 | +import {ComponentFixture, DeferBlockState, TestBed, tick} from '@angular/core/testing'; |
| 13 | +import {BrowserAnimationsModule, NoopAnimationsModule} from '@angular/platform-browser/animations'; |
| 14 | +import {NavigationExtras, Router} from '@angular/router'; |
| 15 | +import {RouterTestingModule} from '@angular/router/testing'; |
| 16 | +import type {BoundFunctions, Queries} from '@testing-library/dom'; |
16 | 17 | import {
|
| 18 | + configure as dtlConfigure, |
17 | 19 | getQueriesForElement as dtlGetQueriesForElement,
|
18 | 20 | prettyDOM as dtlPrettyDOM,
|
| 21 | + queries as dtlQueries, |
| 22 | + screen as dtlScreen, |
19 | 23 | waitFor as dtlWaitFor,
|
20 | 24 | waitForElementToBeRemoved as dtlWaitForElementToBeRemoved,
|
21 |
| - screen as dtlScreen, |
22 |
| - within as dtlWithin, |
23 | 25 | waitForOptions as dtlWaitForOptions,
|
24 |
| - configure as dtlConfigure, |
25 |
| - queries as dtlQueries, |
| 26 | + within as dtlWithin, |
26 | 27 | } from '@testing-library/dom';
|
27 |
| -import type { Queries, BoundFunctions } from '@testing-library/dom'; |
28 |
| -import { RenderComponentOptions, RenderTemplateOptions, RenderResult, ComponentOverride } from './models'; |
29 |
| -import { getConfig } from './config'; |
| 28 | +import {ComponentOverride, RenderComponentOptions, RenderResult, RenderTemplateOptions} from './models'; |
| 29 | +import {getConfig} from './config'; |
30 | 30 |
|
31 | 31 | const mountedFixtures = new Set<ComponentFixture<any>>();
|
32 | 32 | const safeInject = TestBed.inject || TestBed.get;
|
@@ -66,6 +66,7 @@ export async function render<SutType, WrapperType = SutType>(
|
66 | 66 | defaultImports = [],
|
67 | 67 | initialRoute = '',
|
68 | 68 | deferBlockStates = undefined,
|
| 69 | + deferBlockBehavior = undefined, |
69 | 70 | configureTestBed = () => {
|
70 | 71 | /* noop*/
|
71 | 72 | },
|
@@ -94,6 +95,7 @@ export async function render<SutType, WrapperType = SutType>(
|
94 | 95 | }),
|
95 | 96 | providers: [...providers],
|
96 | 97 | schemas: [...schemas],
|
| 98 | + deferBlockBehavior: deferBlockBehavior as any |
97 | 99 | });
|
98 | 100 | overrideComponentImports(sut, componentImports);
|
99 | 101 | overrideChildComponentProviders(childComponentOverrides);
|
|
0 commit comments