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

setInput was removed? #659

Open
crfrolik opened this issue Jun 10, 2024 · 6 comments
Open

setInput was removed? #659

crfrolik opened this issue Jun 10, 2024 · 6 comments

Comments

@crfrolik
Copy link

Is this a regression?

Yes

Description

Upgrading from v16 to v18, and now I am getting errors like this:

Error: src/app/shared/value-input/list-editor.component.spec.ts:272:12 - error TS2339: Property 'setInput' does not exist on type 'SpectatorHost<ListEditorComponent, ListEditorHostComponent>'.

272       host.setInput({subType: TypeInfoString});

I did not see any breaking changes in the changelog for this - just for props/setProps.

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

No response

Please provide the environment you discovered this bug in

No response

Anything else?

No response

Do you want to create a pull request?

No

@levsim2016
Copy link

levsim2016 commented Jul 10, 2024

@NetanelBasal @dirkluijk Do you have any thoughts on this issue?

@crfrolik
Copy link
Author

@NetanelBasal @dirkluijk Do you have any thoughts on this issue?

I migrated my unit tests from setInput to setHostInput. In some cases I had to add a host component for tests where I previously didn't have one.

If this was intended, then I think the main issue here is that the list of breaking changes in the changelog did not include this.

@levsim2016
Copy link

Well, that sucks. That means i have to change at least 5k unit test files. That's ridiculous! Could we have another solution?

@levsim2016
Copy link

@NetanelBasal @dirkluijk Can it be a regression bug?

@levsim2016
Copy link

@crfrolik So you had to add some boilerplate code (host component, i.e. ), isn't? I don't want to criticize, but I think your solution isn't good at all. We chose spectator, because it could get rid of writing that boilerplate code

@brunovillani
Copy link

It seems you can set a value directly into the input. I'm testing directives and I found that spectator.directive.<input> = <value> works fine.

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

3 participants