Home / Class/ ReorderedInputsTestCase Class — react Architecture

ReorderedInputsTestCase Class — react Architecture

Architecture documentation for the ReorderedInputsTestCase class in ReorderedInputsTestCase.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  a33e43ad_38ac_bddf_c730_fbfb041855ce["ReorderedInputsTestCase"]
  209c92e7_f698_d039_e163_bf03ab022808["ReorderedInputsTestCase.js"]
  a33e43ad_38ac_bddf_c730_fbfb041855ce -->|defined in| 209c92e7_f698_d039_e163_bf03ab022808
  ffc859e1_516d_871b_dc41_966731199ad2["componentDidMount()"]
  a33e43ad_38ac_bddf_c730_fbfb041855ce -->|method| ffc859e1_516d_871b_dc41_966731199ad2
  f3941225_1b0a_c0da_b326_d0859f02cd51["componentWillUnmount()"]
  a33e43ad_38ac_bddf_c730_fbfb041855ce -->|method| f3941225_1b0a_c0da_b326_d0859f02cd51
  c1887244_3786_ef72_e707_aace70117305["renderInputs()"]
  a33e43ad_38ac_bddf_c730_fbfb041855ce -->|method| c1887244_3786_ef72_e707_aace70117305
  40d9fa95_7f22_055f_ab42_1280a5247085["render()"]
  a33e43ad_38ac_bddf_c730_fbfb041855ce -->|method| 40d9fa95_7f22_055f_ab42_1280a5247085

Relationship Graph

Source Code

fixtures/dom/src/components/fixtures/selection-events/ReorderedInputsTestCase.js lines 5–44

export default class ReorderedInputsTestCase extends React.Component {
  state = {count: 0};

  componentDidMount() {
    this.interval = setInterval(() => {
      this.setState({count: this.state.count + 1});
    }, 2000);
  }

  componentWillUnmount() {
    clearInterval(this.interval);
  }

  renderInputs() {
    const inputs = [
      <input key={1} defaultValue="Foo" />,
      <input key={2} defaultValue="Bar" />,
    ];
    if (this.state.count % 2 === 0) {
      inputs.reverse();
    }
    return inputs;
  }

  render() {
    return (
      <TestCase title="Reordered input elements in iframes" description="">
        <TestCase.Steps>
          <li>The two inputs below swap positions every two seconds</li>
          <li>Select the text in either of them</li>
          <li>Wait for the swap to occur</li>
        </TestCase.Steps>
        <TestCase.ExpectedResult>
          The selection you made should be maintained
        </TestCase.ExpectedResult>
        <Iframe height={50}>{this.renderInputs()}</Iframe>
      </TestCase>
    );
  }
}

Domain

Frequently Asked Questions

What is the ReorderedInputsTestCase class?
ReorderedInputsTestCase is a class in the react codebase, defined in fixtures/dom/src/components/fixtures/selection-events/ReorderedInputsTestCase.js.
Where is ReorderedInputsTestCase defined?
ReorderedInputsTestCase is defined in fixtures/dom/src/components/fixtures/selection-events/ReorderedInputsTestCase.js at line 5.

Analyze Your Own Codebase

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

Try Supermodel Free