Create New Item
×
Item Type
File
Folder
Item Name
×
Search file in folder and subfolders...
File Manager
/
sommilito-bank2
/
splide-4.1.3
/
src
/
js
/
utils
/
dom
/
parseHtml
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
import { parseHtml } from './parseHtml'; describe( 'parseHtml', () => { test( 'can parse the provided HTML string.', () => { const div = parseHtml( '<div id="container" class="active"><span>content</span></div>' ); expect( div.id ).toBe( 'container' ); expect( div.classList.contains( 'active' ) ).toBe( true ); expect( div.firstElementChild.tagName.toUpperCase() ).toBe( 'SPAN' ); expect( div.firstElementChild.textContent ).toBe( 'content' ); } ); test( 'can parse the provided SVG string.', () => { const svg = parseHtml( '<svg id="icon"><path d="m19 18-14-13m0 13 14-13"></path></svg>' ); expect( svg instanceof SVGElement ).toBe( true ); expect( svg.id ).toBe( 'icon' ); expect( svg.firstElementChild.tagName.toUpperCase() ).toBe( 'PATH' ); } ); } );