From d50eb338f335435ba830c56d0fe164c475830610 Mon Sep 17 00:00:00 2001 From: Younes Jaaidi Date: Fri, 23 Feb 2024 01:27:21 +0100 Subject: [PATCH] refactor(ct-angular): fix angular outputs --- packages/playwright-ct-angular/registerSource.mjs | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/packages/playwright-ct-angular/registerSource.mjs b/packages/playwright-ct-angular/registerSource.mjs index 3f7b3ff561..250c87d535 100644 --- a/packages/playwright-ct-angular/registerSource.mjs +++ b/packages/playwright-ct-angular/registerSource.mjs @@ -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 */