Comments (7)
I trust you to reach a solution and open a PR
from spectator.
Sorry for the delay.
This is the relevant PR #652
from spectator.
Start a new pull request in StackBlitz Codeflow.
from spectator.
How about if we provide a more loose function overload?
public setInput(input: string, inputValue: unknown): void;
I think something similar exists also in Angular repo
https://github.com/angular/angular/blob/da906fdafcbb302fa280a162d1c1f04369be2efa/packages/core/src/linker/component_factory.ts#L34
from spectator.
How about if we provide a more loose function overload?
public setInput(input: string, inputValue: unknown): void;I think something similar exists also in Angular repo https://github.com/angular/angular/blob/da906fdafcbb302fa280a162d1c1f04369be2efa/packages/core/src/linker/component_factory.ts#L34
@kfrancois @NetanelBasal what do you think?
from spectator.
Hi @profanis! Thank you for logging this issue.
I think what you propose is the best possible option at the moment. Unfortunately, input aliases are defined as string
inside the Angular repo:
interface InputOptions<ReadT, WriteT> {
alias?: string;
transform?: (v: WriteT) => ReadT;
If this were a generic type (or rather, if alias
was generic instead of string
), we would at least be able to infer the correct field name and use it for setInput
(at least for signal inputs, traditional inputs we wouldn't be able to do anything), but for now it feels safer to lose type info here and go with input: string, inputValue: unknown
.
from spectator.
Can we close it?
from spectator.
Related Issues (20)
- Using SIFERS pattern to setup test in spectator
- `change` event is never fired when faking a file drop on custom input
- { shallow: true } doesn't mock standalone components/directives/pipes HOT 3
- inject does not find directive provider
- Support Angular 17 HOT 2
- Cannot resolve "styleUrl"
- Add support for input signals HOT 14
- Do not import `@jest/globals` outside of the Jest test environment HOT 2
- Testing for functional guards HOT 4
- Spectator#setInput does not to update UI Elements for Components with changeDetectionStrategy OnPush HOT 6
- TypeError: Cannot read properties of undefined (reading 'Playthrough') HOT 1
- Support of Web Test Runner HOT 1
- Spectator is forcing to add a transform explicitly if input() has got a transform function HOT 4
- Cannot pass props which are not input() type in createComponent() HOT 7
- Angular 17 - input with transform HOT 8
- Angular 17 signal required input HOT 4
- Host component's `ngOnChanges` is not called when testing directive using `createDirectiveFactory`
- setInput was removed? HOT 5
- Signal input is not recognized in component HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spectator.