Skip to content
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: MockBuilder a standalone component that imports a standalone directive, it fails #3100

Closed
trystan2k opened this issue Jul 14, 2022 · 3 comments · Fixed by #3105
Closed
Assignees
Labels
bug Something isn't working released v14.1.0

Comments

@trystan2k
Copy link

Description of the bug

When mocking a standalone directive imported by a standalone component, an error is throw saying that MockOfDirective is not standalone

Error: The "MockOfTestDirective" directive, imported from "TargetComponent", is not standalone. Did you forget to add the standalone: true flag?

An example of the bug

https://stackblitz.com/edit/github-7zh6cj?file=src%2Ftest.spec.ts

Link:

Expected vs actual behavior

Since the original imported directive (TestDirective) is a standalone: true directive, the mocked version (MockOfTestDirective) should also be a standalone and the MockBuilder should be able to mock it as expected.

Not sure if I am missing anything or doing something wrong, but I did the same test with a standalone Pipe and it worked ok.
Is this scenario already supported ?
What I could be doing wrong here ?

Thanks !

@trystan2k trystan2k added the bug Something isn't working label Jul 14, 2022
@trystan2k trystan2k changed the title Bug: Bug: MockBuilder a standalone component that imports a standalone directive, it fails Jul 14, 2022
@satanTime
Copy link
Member

Hi @trystan2k,

thanks for reporting the issue. The fix will be released within next hours.

satanTime added a commit that referenced this issue Jul 15, 2022
fix(core): detecting and mocking standalone directives correctly #3100
@satanTime
Copy link
Member

v14.1.0 has been released and contains a fix for the issue. Feel free to reopen the issue or to submit a new one if you meet any problems.

@trystan2k
Copy link
Author

Hi @satanTime,

I just tested it and it worked perfectly !

Thanks you very much !!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released v14.1.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants