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

Add ngx-translate coverage in e2e #10752

Open
satanTime opened this issue Jan 12, 2025 · 0 comments
Open

Add ngx-translate coverage in e2e #10752

satanTime opened this issue Jan 12, 2025 · 0 comments

Comments

@satanTime
Copy link
Member

satanTime commented Jan 12, 2025

The fix isn't sufficient to support non-standalone components in third-party libraries like ngx-translate.
I applied the following fix to ensure support:
libs/ng-mocks/src/lib/mock/decorate-declaration.ts

@@ -46,6 +46,8 @@ export default <T extends Component & Directive>(
    },
  params: T,
): Component & Directive => {

+  const standalone = ((source as any).ɵcmp || (source as any).ɵdir || (source as any).ɵpipe)?.standalone;
  const hasResolver = ngMocksUniverse.config.has('mockNgDefResolver');
  if (!hasResolver) {
    ngMocksUniverse.config.set('mockNgDefResolver', new CoreDefStack());
@@ -61,10 +63,14 @@ export default <T extends Component & Directive>(
  if (meta.selector !== undefined) {
    options.selector = meta.selector;
  }

  if (meta.standalone !== undefined) {
    options.standalone = meta.standalone;
+  } else if (standalone !== undefined) {
+    options.standalone = standalone;
  }

Originally posted by @ytchenak in #10583 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant