MCPcopy Index your code
hub / github.com/angular/components / verifyPathChildElement

Function verifyPathChildElement

src/material/icon/icon.spec.ts:41–48  ·  view source on GitHub ↗

* Verifies that an element contains a single ` ` child element whose "id" attribute has * the specified value.

(element: Element, attributeValue: string)

Source from the content-addressed store, hash-verified

39 * the specified value.
40 */
41function verifyPathChildElement(element: Element, attributeValue: string): void {
42 expect(element.childNodes.length).toBe(1);
43 const pathElement = element.childNodes[0] as SVGPathElement;
44 expect(pathElement.tagName.toLowerCase()).toBe('path');
45
46 // The testing data SVGs have the name attribute set for verification.
47 expect(pathElement.getAttribute('name')).toBe(attributeValue);
48}
49
50/** Creates a test component fixture. */
51function createComponent<T>(component: Type<T>, providers: Provider[] = []) {

Callers 1

icon.spec.tsFile · 0.85

Calls 1

getAttributeMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…