From 5f12b0e1e0197996f81c1d19f1c886ee4714acca Mon Sep 17 00:00:00 2001 From: jnizet Date: Sun, 17 Jun 2018 22:11:12 +0200 Subject: [PATCH] docs: add note about detectChanges in the API documentation refs #33 --- projects/ngx-speculoos/src/lib/component-tester.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/projects/ngx-speculoos/src/lib/component-tester.ts b/projects/ngx-speculoos/src/lib/component-tester.ts index 2affb583..0b4541dc 100644 --- a/projects/ngx-speculoos/src/lib/component-tester.ts +++ b/projects/ngx-speculoos/src/lib/component-tester.ts @@ -35,6 +35,12 @@ export class ComponentTester { /** * Creates a ComponentFixture for the given component type using the TestBed, and creates a ComponentTester * wrapping (and delegating) to this fixture. If a fixture is passed, then delegates to this fixture directly. + * + * Note that no `detectChanges()` call is made by this constructor. It's up to the subclass constructor, + * or to the user of the created ComponentTester, to call `detectChanges()` at least once to trigger change + * detection. This is necessary because some component templates can only be evaluated once inputs + * have been set on the component instance. + * * @param arg the type of the component to wrap, or a component fixture to wrap */ constructor(arg: Type | ComponentFixture) {