See currently ignored test shows mermaidjs error content in the diagram container when rendering fails.
Root of the issue appears to be that the mermaid error content is not correctly added to our DOM when we are in the test environment. In the browser it seems to render fine (I think it even may have rendered correctly one time in the debugger).
Most likely the Mermaid.js library is using the global document object for something, compared to what is in JSDOM, and there is a clash. Enable the test to debug and fix. This will allow us to verify that Mermaid.js shows proper error output. At the moment I have to verify this manually.
Note that interestingly Mermaid success output renders in JSDOM just fine.
Also note that if you do not pass the container div to mermaidjs (so that it renders the error content in the global document object) we also see the expected error output.
See currently ignored test
shows mermaidjs error content in the diagram container when rendering fails
.Root of the issue appears to be that the mermaid error content is not correctly added to our DOM when we are in the test environment. In the browser it seems to render fine (I think it even may have rendered correctly one time in the debugger).
Most likely the Mermaid.js library is using the global document object for something, compared to what is in JSDOM, and there is a clash. Enable the test to debug and fix. This will allow us to verify that Mermaid.js shows proper error output. At the moment I have to verify this manually.
Note that interestingly Mermaid success output renders in JSDOM just fine.
Also note that if you do not pass the container div to mermaidjs (so that it renders the error content in the global document object) we also see the expected error output.