MCPcopy Create free account
hub / github.com/angular/components / verifyAndGetSingleSvgChild

Function verifyAndGetSingleSvgChild

src/material/icon/icon.spec.ts:29–35  ·  view source on GitHub ↗

* Verifies that an element contains a single ` ` child element, and returns that child.

(element: SVGElement)

Source from the content-addressed store, hash-verified

27 * Verifies that an element contains a single `<svg>` child element, and returns that child.
28 */
29function verifyAndGetSingleSvgChild(element: SVGElement): SVGElement {
30 expect(element.id).toBeFalsy();
31 expect(element.childNodes.length).toBe(1);
32 const svgChild = element.childNodes[0] as SVGElement;
33 expect(svgChild.tagName.toLowerCase()).toBe('svg');
34 return svgChild;
35}
36
37/**
38 * Verifies that an element contains a single `<path>` child element whose "id" attribute has

Callers 1

icon.spec.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected