-
-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: fixture.getDeferBlocks() returns no defer blocks if we want to use any ng-mocks mock inside the test #7742
Comments
While we are waiting for the solution, this is my workaround:
The inputs and other meta configuration will be the same. |
Hi! Any news on this? I have exactly the same issue and I can't use the workaround as I need to prevent the child component to pull all its dependencies. |
@satanTime Can you give us an update, will it be investigated/fixed? |
Hello there, I'm facing the same issue. Is there any update on this? |
Does |
same problem here, any chance this can get fixed? it's quite a serious issue |
Hi all, this is the next one on my todo. If you can post here more examples (broken code) of what you want to achieve, it would be great. Thank you in advance. |
@satanTime that's great to hear. As an example, basically the standard flow to test any https://angular.dev/guide/templates/defer#testing-defer-blocks the problem is, in my case for example, |
@satanTime So the expected case would be to have this example test case passing even with using ngmock's overrideComponent thanks in advance |
Description of the bug
There a problem when trying to use ng-mocks in test which would like to use tools for new @defer block testing,
the problem is:
fixture.getDeferBlocks();
will return no defer blocks if we have any ng-mocks mock inside the test.
An example of the bug
Here is minimalistic example to reproduce
angular-jest-defer-ng-mock.zip
check
test-defer.component.spec.ts
in the example projectif we comment out
.overrideComponent(...)
from component ts file and<test-child-defer />
line from template, the test will pass.Expected vs actual behavior
Mocking components with ng-mock has no effect on fixture.getDeferBlocks() functioning, it will return defer block correctly.
The text was updated successfully, but these errors were encountered: