Improve GFM Feature Specs
In !83202 (merged) we fixed the copy to clipboard button for mermaid diagrams, but struggled to write a good feature spec. When the copied content is pasted, the code fences are missing in capybara...
For now we simple expect to the pasted value to be missing the codefence, but it would be great to improve the spec to expect what we actually expect.
@pslaughter kindly did some digging and suggests:
I took a minute to look at this, and by adding
throw new Error(...)
lines, I was able to confirm that we are successfully callingclipboardData.setData('text/x-gfm'...)
here:But!
gfm
ends up being empty when we are pastingThese special
x-
clipboard data might not be supported in all environments... Something to look into:
- Maybe we can just read directly form the clipboard https://gist.github.com/ParamagicDev/5fe937ee60695ff1d227f18fe4b1d5c4 ?
- Maybe we need to set some Capybara driver permission to get
text/x-gfm
to work?- Maybe we need to look into what we're setting for
text/plain
🤔
Edited by Lee Tickett