Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Angular/Web component tests fail with .ts or .js as file extension #29544

Open
sand4rt opened this issue Feb 18, 2024 · 1 comment · May be fixed by #30269
Open

[Bug]: Angular/Web component tests fail with .ts or .js as file extension #29544

sand4rt opened this issue Feb 18, 2024 · 1 comment · May be fixed by #30269
Assignees

Comments

@sand4rt
Copy link
Collaborator

sand4rt commented Feb 18, 2024

Version

1.41.1

Steps to reproduce

  1. clone the repo chore: bump playwright to 1.41.1 sand4rt/playwright-ct-web#36
  2. run pnpm i
  3. run pnpm test

Expected behavior

the test should pass

Actual behavior

the tests fail

logs: https://github.com/sand4rt/playwright-ct-web/actions/runs/7943833528/job/21688654668?pr=36#step:8:68

Additional context

I'm unable to upgrade the Angular and web/lit component testing libraries from version v1.41.0 to v1.41.1 because the transform process was improved recently. The issue lies in the components not being transformed into refs. This occurs because Angular/Lit components are used as .ts files, while the transformation process in playwright-ct-core only handles non-JavaScript imports, as indicated here: https://github.com/microsoft/playwright/blob/main/packages/playwright-ct-core/src/tsxTransform.ts#L78

Is it an option to verify if the import is used within the mount() instead of verifying the file extension?

Related to #27783

@sand4rt
Copy link
Collaborator Author

sand4rt commented Mar 31, 2024

@yjaaidi applied a solution in: https://github.com/sand4rt/playwright/pull/5/files#diff-8dd3534dc5013c3779edeaded71324b0dd1c1807668f3c6d9e9a1aab1c20ae91

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants