refactor(ct-angular): fix angular outputs

This commit is contained in:
Younes Jaaidi 2024-02-23 01:27:21 +01:00
parent 048cb7dd8a
commit d50eb338f3
No known key found for this signature in database
GPG key ID: 3126C5717BDF3241

View file

@ -61,19 +61,15 @@ window.playwrightUnmount = async rootElement => {
};
window.playwrightUpdate = async (rootElement, component) => {
await resolveComponent(component);
if (component.kind === 'jsx')
throw new Error('JSX mount notation is not supported');
if (component.options?.slots)
if (component.slots)
throw new Error('Update slots is not supported yet');
const fixture = __pwFixtureRegistry.get(rootElement.id);
if (!fixture)
throw new Error('Component was not mounted');
__pwUpdateProps(fixture, component.options?.props);
__pwUpdateEvents(fixture, component.options?.on);
__pwUpdateProps(fixture, component.props);
__pwUpdateEvents(fixture, component.on);
fixture.detectChanges();
};
@ -124,11 +120,6 @@ async function __pwRenderComponent(component) {
return fixture;
}
// async function __pwResolveComponent(component) {
// // const component = await window.__pwRegistry.resolveImportRef(component.type);
// return await
// }
/**
* @param {import('@angular/core/testing').ComponentFixture} fixture
*/