Home / File/ ReorderedInputsTestCase.js — react Source File

ReorderedInputsTestCase.js — react Source File

Architecture documentation for ReorderedInputsTestCase.js, a javascript file in the react codebase. 3 imports, 1 dependents.

File javascript BabelCompiler Optimization 3 imports 1 dependents 1 classes

Entity Profile

Dependency Diagram

graph LR
  209c92e7_f698_d039_e163_bf03ab022808["ReorderedInputsTestCase.js"]
  14dde3c9_48ef_6e34_3667_978d06aff15d["TestCase.js"]
  209c92e7_f698_d039_e163_bf03ab022808 --> 14dde3c9_48ef_6e34_3667_978d06aff15d
  e1e356f5_b085_dad5_a81f_4b4844381311["TestCase"]
  209c92e7_f698_d039_e163_bf03ab022808 --> e1e356f5_b085_dad5_a81f_4b4844381311
  70b5253e_813d_8b9b_6dca_779425403139["Iframe.js"]
  209c92e7_f698_d039_e163_bf03ab022808 --> 70b5253e_813d_8b9b_6dca_779425403139
  503fee95_ee49_322b_ba32_deaaeb5199cf["index.js"]
  503fee95_ee49_322b_ba32_deaaeb5199cf --> 209c92e7_f698_d039_e163_bf03ab022808
  style 209c92e7_f698_d039_e163_bf03ab022808 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import TestCase from '../../TestCase';
import Iframe from '../../Iframe';
const React = window.React;

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

Subdomains

Frequently Asked Questions

What does ReorderedInputsTestCase.js do?
ReorderedInputsTestCase.js is a source file in the react codebase, written in javascript. It belongs to the BabelCompiler domain, Optimization subdomain.
What does ReorderedInputsTestCase.js depend on?
ReorderedInputsTestCase.js imports 3 module(s): Iframe.js, TestCase, TestCase.js.
What files import ReorderedInputsTestCase.js?
ReorderedInputsTestCase.js is imported by 1 file(s): index.js.
Where is ReorderedInputsTestCase.js in the architecture?
ReorderedInputsTestCase.js is located at fixtures/dom/src/components/fixtures/selection-events/ReorderedInputsTestCase.js (domain: BabelCompiler, subdomain: Optimization, directory: fixtures/dom/src/components/fixtures/selection-events).

Analyze Your Own Codebase

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

Try Supermodel Free