You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to write a unit test for it and ran into some issues. I thought this test would do the job, however, the test always fails because the done() method never fires because the trix-initialize event is never triggered.
I looked into this for a while. At first I thought it might be due to the fact that Trix uses customElements and JSDOM 15 (which is what Jest uses) doesn't support them. So I found a workaround where you can force jest to load JSDOM 16, but that didn't solve the issue. Turns out Trix ships with a polyfill for customElements anyways. So that was a bit of a dead end.
I am raising this issue because I was stumped by it and couldn't figure out how to make it work. I am curious if anyone else has any ideas.
The text was updated successfully, but these errors were encountered:
Yesterday I submitted a PR #177 to add autofocus.
I tried to write a unit test for it and ran into some issues. I thought this test would do the job, however, the test always fails because the
done()
method never fires because thetrix-initialize
event is never triggered.I looked into this for a while. At first I thought it might be due to the fact that Trix uses
customElements
and JSDOM 15 (which is what Jest uses) doesn't support them. So I found a workaround where you can force jest to load JSDOM 16, but that didn't solve the issue. Turns out Trix ships with a polyfill for customElements anyways. So that was a bit of a dead end.I am raising this issue because I was stumped by it and couldn't figure out how to make it work. I am curious if anyone else has any ideas.
The text was updated successfully, but these errors were encountered: