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

createPipe doesn't pickup arguments to pipes #600

Open
martin-juul opened this issue Feb 7, 2023 · 0 comments
Open

createPipe doesn't pickup arguments to pipes #600

martin-juul opened this issue Feb 7, 2023 · 0 comments

Comments

@martin-juul
Copy link

martin-juul commented Feb 7, 2023

Is this a regression?

No

Description

When testing a pipe it is not possible to pass arguments to the pipe.

describe('FooPipe', () => {
  let spectator: SpectatorPipe<FooPipe>;
  const createPipe = createPipeFactory(FooPipe);

  it('should change the background color', () => {
    // @ts-ignore used in template
    const model = {a: 1, b: 2, c: 3};

    spectator = createPipe(`<div>{{ 'EUR 0' | fooPipe: model }}</div>`, {
      hostProps: model,
    });

    expect(spectator.element).toHaveText('foobar');
  });
});

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

TypeError: Cannot read property 'tender' of undefined
    at FooPipe.transform (projects/foo/src/app/foo.ts:13:15)
    at pureFunction2Internal (node_modules/@angular/core/fesm2015/core.mjs:22302:1)
    at ɵɵpipeBind2 (node_modules/@angular/core/fesm2015/core.mjs:22484:1)
    at HostComponent_Template (ng:///HostComponent.js:14:33)
    at executeTemplate (node_modules/@angular/core/fesm2015/core.mjs:9717:1)
    at refreshView (node_modules/@angular/core/fesm2015/core.mjs:9580:1)
    at refreshComponent (node_modules/@angular/core/fesm2015/core.mjs:10777:1)
    at refreshChildComponents (node_modules/@angular/core/fesm2015/core.mjs:9376:1)
    at refreshView (node_modules/@angular/core/fesm2015/core.mjs:9630:1)
    at renderComponentOrTemplate (node_modules/@angular/core/fesm2015/core.mjs:9697:1)

Please provide the environment you discovered this bug in

No response

Anything else?

No response

Do you want to create a pull request?

No

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