-
Notifications
You must be signed in to change notification settings - Fork 137
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
@embroider/test-setup v2 causes assertion for HTML encoded char to fail #1380
Comments
I tried reproducing the issue preventing us from asserting against the HTML encoded character. But I was not able to reproduce it in a simplified setup: https://github.com/jelhan/ember-test-embroider-test-setup-with-html-encoded-char Nevertheless here is a PR for Ember Bootstrap showing that it fails for that complex addon: ember-bootstrap/ember-bootstrap#1912 I guess there is another thing playing into it... |
I believe what has changed in I vaguely remember you had brought up a similar issue before, right? What was the problem then, and the fix? |
I mentioned that issue some weeks ago on Discord. But haven't had time to create a GitHub issue yet. Noticed it first in Ember Bootstrap around January. Not solved yet. Just haven't had time to get back to it. |
I'm seeing this issue with embroider v3 in our embroider tests as well. I'm unable to reproduce it in a simple app, it may have to do with the number of |
This looks like a glimmer printer bug. In a quick check, it looks like parsing and re-printing a template does: -×
+× If I'm right, this bug happens only in components inside addons, and only when those addons have some custom AST transforms applied. Under those conditions, embroider needs to compile away the custom stuff before the app builds, so it will run the component's template through the template compiler, re-serializing to hbs after transforming. |
Might be fixed already and we're not using the right setting here: glimmerjs/glimmer-vm#938 |
This is the fix: emberjs/babel-plugin-ember-template-compilation#20 |
Fixed in babel-plugin-ember-template-compilation 2.0.3. As it's a patch release, no embroider release is needed, just make sure you let your deps float (or patch your lockfile) so you get the update. |
Thanks @ef4, this fixed the issue for me 🎉 |
I noticed a regression if an application renders a HTML encoded character and asserts against the character not being encoded in
@embroider/test-setup
v2.I have a component, which renders
×
: https://github.com/ember-bootstrap/ember-bootstrap/blob/d6cf431bf2871debf04915967271419a0c848fdb/addon/components/bs-modal/header/close.hbs#L2I have a test, which asserts
assert.dom(this.element).hasText('×');
.The assertion is working fine in non-Embroider builds and with
@embroider/test-setup
v1. But it starts to fail when upgrading to@embroider/test-setup
v2: ember-bootstrap/ember-bootstrap#1857Asserting against the encoded HTML character works with
@embroider/test-setup
v2 but does not work with non-Embroider builds. At this point I'm stuck.The text was updated successfully, but these errors were encountered: