-
Notifications
You must be signed in to change notification settings - Fork 11
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: Tests are not rendered properly after version > 4.6.0 #699
Comments
TODO:
|
The ES5 polyfill included in the default loader messes with prettyDOM, which is used by testing-library. To fix this, we patch the loader package.json, the react and the vue output target imports to use the ES2017 code. Fixes #699
The ES5 polyfill included in the default loader messes with prettyDOM, which is used by testing-library. To fix this, we patch the loader package.json, the react and the vue output target imports to use the ES2017 code. Fixes #699
## [5.4.1](v5.4.0...v5.4.1) (2023-05-12) ### Bug Fixes * **loader:** use ES2017 loader ([a079410](a079410)), closes [#699](#699)
🎉 This issue has been resolved in version 5.4.1 🎉 The release is available on: 📦🚀 |
Prerequisites
Liquid version
4.6.0 and above
Framework bindings
React
Current behavior
Looks like RTL cannot render liquid components properly. When we are using
defineCustomElements()
in tests it renders plain JSX element instead of HTML tag but only for some specific tags like<article>
|<section>
|<header>
|<footer>
etc. Before version 4.6.0 we did not usedefineCustomElements()
and everything was rendered properly. Because of that we are not able to generate snapshots and write tests for elements which are children of liquid elements.defineCustomElements()
and using<article>
= invaliddefineCustomElements()
and using<div>
= validdefineCustomElements()
and using<article>
= validdefineCustomElements()
and using<div>
= validdefineCustomElements()
and using<LdCard><article></LdCard>
= invalid // Was valid on previous versionsdefineCustomElements()
and using<LdCard><div></LdCard>
= validSo the behaviour is really weird and inconsistent.
Expected behavior
All components and html tags should be rendered properly in jest-dom.
Steps to reproduce
Code reproduction URL
https://codesandbox.io/p/github/emdgroup-liquid/liquid-sandbox-cra-tailwind/csb-lqyi2w/draft/fervent-curran?file=/src/App.test.tsx:15,4&selection=[{%22endColumn%22:52,%22endLineNumber%22:8,%22startColumn%22:52,%22startLineNumber%22:8}]
Additional information
No response
The text was updated successfully, but these errors were encountered: