spectator icon indicating copy to clipboard operation
spectator copied to clipboard

setInput was removed?

Open crfrolik opened this issue 1 year ago • 6 comments

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

crfrolik avatar Jun 10 '24 18:06 crfrolik

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

levsim2016 avatar Jul 10 '24 20:07 levsim2016

@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.

crfrolik avatar Jul 10 '24 20:07 crfrolik

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

levsim2016 avatar Jul 10 '24 22:07 levsim2016

@NetanelBasal @dirkluijk Can it be a regression bug?

levsim2016 avatar Jul 10 '24 22:07 levsim2016

@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

levsim2016 avatar Jul 10 '24 23:07 levsim2016

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.

brunovillani avatar Sep 10 '24 16:09 brunovillani