Home / Function/ testDOMNodeStructure() — react Function Reference

testDOMNodeStructure() — react Function Reference

Architecture documentation for the testDOMNodeStructure() function in ReactART-test.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  f69b01aa_b394_11e0_1f2e_0d30033fd639["testDOMNodeStructure()"]
  1ac9edb3_efa7_97a7_5bb1_dd244773303f["ReactART-test.js"]
  f69b01aa_b394_11e0_1f2e_0d30033fd639 -->|defined in| 1ac9edb3_efa7_97a7_5bb1_dd244773303f
  style f69b01aa_b394_11e0_1f2e_0d30033fd639 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/react-art/src/__tests__/ReactART-test.js lines 44–64

function testDOMNodeStructure(domNode, expectedStructure) {
  expect(domNode).toBeDefined();
  expect(domNode.nodeName).toBe(expectedStructure.nodeName);
  for (const prop in expectedStructure) {
    if (!expectedStructure.hasOwnProperty(prop)) {
      continue;
    }
    if (prop !== 'nodeName' && prop !== 'children') {
      if (expectedStructure[prop] === Missing) {
        expect(domNode.hasAttribute(prop)).toBe(false);
      } else {
        expect(domNode.getAttribute(prop)).toBe(expectedStructure[prop]);
      }
    }
  }
  if (expectedStructure.children) {
    expectedStructure.children.forEach(function (subTree, index) {
      testDOMNodeStructure(domNode.childNodes[index], subTree);
    });
  }
}

Domain

Subdomains

Frequently Asked Questions

What does testDOMNodeStructure() do?
testDOMNodeStructure() is a function in the react codebase, defined in packages/react-art/src/__tests__/ReactART-test.js.
Where is testDOMNodeStructure() defined?
testDOMNodeStructure() is defined in packages/react-art/src/__tests__/ReactART-test.js at line 44.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free