Skip to content

Bug: Can't bind to 'property' of a third-party standalone component #11214

@kkoo95

Description

@kkoo95

Description of the bug

I have a standalone component which imports a standalone component from a third-party lib. And when i run my tests fairly simply with MockBuilder, i get warnings/errors in the console like:

NG0303: Can't bind to 'property' since it isn't a known property of 'ext-component' (used in the 'MyTestedComponent' component template).

An example of the bug

import { ExtComponent } from '@org/lib';
import { Component } from '@angular/core';

@Component({
    selector: 'my-component',
    standalone: true,
    imports: [ExtComponent],
    template: `<ext-component [property]="42" /> `
})
export class MyTestedComponent {}
describe('MyTestedComponent', () => {
    beforeEach(() => MockBuilder(MyTestedComponent));

    it('should create', () => {
        expect(MockRender(MyTestedComponent)).toBeDefined();
    });
});

Link

Expected vs actual behavior

I shouldnt give an error

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions