RobinMeow / CommunityCookbook

CommunityCookbook
MIT License
0 stars 0 forks source link

remove cypress component tests #101

Closed RobinMeow closed 5 months ago

RobinMeow commented 5 months ago

wierd code example:

cy.mount(Header, {
    providers: [provideAppName(), provideRouter([])],
    componentProperties: {
    // eslint-disable-next-line @typescript-eslint/no-explicit-any
    hideMenuButton: signal(false) as any
  }
})
// OR 
.then(x => {
  x.fixture.componentRef.setInput(...) // works
  x.fixture.detectChanges() // bad side effects
}).as('setup') // doesnt work, and cannot be await

we are assigning a signal to the variable, which is of type InputSignal. However input signals cannot be used outside the injection context, therefore use something elsew. This works only because input signals are are similar (but read only). But they dont have to be, which makes it prone to error.