mirror of
https://github.com/discourse/discourse.git
synced 2025-06-13 18:04:35 +08:00
DEV: adds a stringToHTML
helper to be used in tests (#8424)
This will replace the need for jquery: `$(string)`
This commit is contained in:
5
test/javascripts/helpers/html-helper.js.es6
Normal file
5
test/javascripts/helpers/html-helper.js.es6
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
export function stringToHTML(string) {
|
||||||
|
const parser = new DOMParser();
|
||||||
|
const doc = parser.parseFromString(string, "text/html");
|
||||||
|
return doc.body.firstChild;
|
||||||
|
}
|
Reference in New Issue
Block a user