-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Description
Current behavior
All our test are failing when we move from Cypress 14 to Cypress 15
This looks like because componentProperties in the mount call are not set on the component.
so we have a wrapper component:
class WrapperComponent {
text = 'MyButton';
}
then we have:
const configWrapper: MountConfig = {
declarations: [XXXX],
imports: [ YYYY]
}
and
configWrapper.componentProperties = {
text: 'MyButton2'
}
then we do
cy.mount(WrapperComponent, configWrapper).then((wrapper) => {
but the text is still "MyButton" not "MyButton2"
we have that will all the properties that we set, the things we init directly in the class are there but the componentProperties are not set over it.
after that if we do:
wrapper.component.text = 'MyButton2';
wrapper.fixture.detectChanges();
then it works
then the component that is wrapped by the component that gets that text property as its own, the onChanges() is called with that change. The initial onchanges of angular is always the class defined values. never the componentProperties defined values.
Desired behavior
that it works like Cypress 14
Test code to reproduce
checking out that project you can run that with npm run cy:open (or run)
that "servoyApi" object has to be set before the component is constructed but we do want to spy on it, so the mound should use the servoyApi object that is set and spyed on in the componentProperties.servoyApi
But that doesn't work anymore so a lot of stuff goes wrong
Cypress Version
15
Node version
v22.15.0
Operating System
windows
Debug Logs
Other
No response