DEV: adds a `stringToHTML` helper to be used in tests (#8424)

This will replace the need for jquery: `$(string)`
This commit is contained in:
Joffrey JAFFEUX 2019-11-27 17:36:45 +01:00 committed by GitHub
parent a227083c1c
commit 119c4d0c1b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -0,0 +1,5 @@
export function stringToHTML(string) {
const parser = new DOMParser();
const doc = parser.parseFromString(string, "text/html");
return doc.body.firstChild;
}