When using deferBlock() with any of the four callbacks i get undefined (reading 'render') and the test exits
even if i use an empty test file and copy the example code from the Spectator docs it fails in the same way
@Component({
selector: 'app-cmp',
template: `
@defer (on viewport) {
<div>Complete state of the first defer block</div> <!--Parent Complete State-->
@defer {
<div>Complete state of the nested defer block</div> <!--Nested Complete State-->
}
} @placeholder {
<div>Placeholder</div>
}
`,
})
class DummyComponent {}
const createComponent = createComponentFactory({
component: DummyComponent,
deferBlockBehavior: DeferBlockBehavior.Manual,
});
it('should render the first nested complete state', async () => {
// Arrange
const spectator = createComponent();
// Act
// Renders the parent complete state
const parentCompleteState = await spectator.deferBlock().renderComplete();
// Renders the nested complete state
await parentCompleteState.deferBlock().renderComplete();
// Assert
expect(spectator.element.outerHTML).toContain('nested defer block');
});
TypeError: Cannot read properties of undefined (reading 'render')
at http://localhost:9876/_karma_webpack_/webpack:/node_modules/@ngneat/spectator/fesm2022/ngneat-spectator.mjs:796:28
at Generator.next (<anonymous>)
at asyncGeneratorStep (http://localhost:9876/_karma_webpack_/webpack:/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js:3:1)
at apply (http://localhost:9876/_karma_webpack_/webpack:/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js:17:1)
at _ZoneDelegate.invoke (http://localhost:9876/_karma_webpack_/webpack:/node_modules/zone.js/fesm2015/zone.js:369:28)
at ProxyZoneSpec.onInvoke (http://localhost:9876/_karma_webpack_/webpack:/node_modules/zone.js/fesm2015/zone-testing.js:2081:39)
at _ZoneDelegate.invoke (http://localhost:9876/_karma_webpack_/webpack:/node_modules/zone.js/fesm2015/zone.js:368:34)
at ZoneImpl.run (http://localhost:9876/_karma_webpack_/webpack:/node_modules/zone.js/fesm2015/zone.js:111:43)
at apply (http://localhost:9876/_karma_webpack_/webpack:/node_modules/zone.js/fesm2015/zone.js:2538:40)
at _ZoneDelegate.invokeTask (http://localhost:9876/_karma_webpack_/webpack:/node_modules/zone.js/fesm2015/zone.js:402:33)
Please provide a link to a minimal reproduction of the bug
No response
Please provide the exception or error you saw
`undefined (reading 'render')`
Please provide the environment you discovered this bug in
Is this a regression?
Yes
Description
When using
deferBlock()
with any of the four callbacks i getundefined (reading 'render')
and the test exitseven if i use an empty test file and copy the example code from the Spectator docs it fails in the same way
Please provide a link to a minimal reproduction of the bug
No response
Please provide the exception or error you saw
Please provide the environment you discovered this bug in
Anything else?
No response
Do you want to create a pull request?
No