Home / Class/ TextInputFixtures Class — react Architecture

TextInputFixtures Class — react Architecture

Architecture documentation for the TextInputFixtures class in index.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  d8384196_ab9d_98fa_dcbc_b835878631af["TextInputFixtures"]
  1d9eef82_a8e2_98f5_d838_60291fc890b8["index.js"]
  d8384196_ab9d_98fa_dcbc_b835878631af -->|defined in| 1d9eef82_a8e2_98f5_d838_60291fc890b8
  59628cfb_d105_40d1_ae57_6f35cd455920["render()"]
  d8384196_ab9d_98fa_dcbc_b835878631af -->|method| 59628cfb_d105_40d1_ae57_6f35cd455920

Relationship Graph

Source Code

fixtures/dom/src/components/fixtures/text-inputs/index.js lines 9–165

class TextInputFixtures extends React.Component {
  render() {
    return (
      <FixtureSet
        title="Inputs"
        description="Common behavior across controlled and uncontrolled inputs">
        <TestCase title="Numbers in a controlled text field with no handler">
          <TestCase.Steps>
            <li>Move the cursor to after "2" in the text field</li>
            <li>Type ".2" into the text input</li>
          </TestCase.Steps>

          <TestCase.ExpectedResult>
            The text field's value should not update.
          </TestCase.ExpectedResult>

          <Fixture>
            <div className="control-box">
              <fieldset>
                <legend>Value as number</legend>
                <input value={2} onChange={() => {}} />
              </fieldset>

              <fieldset>
                <legend>Value as string</legend>
                <input value={'2'} onChange={() => {}} />
              </fieldset>
            </div>
          </Fixture>

          <p className="footnote">
            This issue was first introduced when we added extra logic to number
            inputs to prevent unexpected behavior in Chrome and Safari (see the
            number input test case).
          </p>
        </TestCase>

        <TestCase
          title="Required Inputs"
          affectedBrowsers="Firefox"
          relatedIssues="8395">
          <TestCase.Steps>
            <li>View this test in Firefox</li>
          </TestCase.Steps>

          <TestCase.ExpectedResult>
            You should{' '}
            <b>
              <i>not</i>
            </b>{' '}
            see a red aura, indicating the input is invalid.
            <br />
            This aura looks roughly like:
            <input style={{boxShadow: '0 0 1px 1px red', marginLeft: 8}} />
          </TestCase.ExpectedResult>

          <Fixture>
            <form className="control-box">
              <fieldset>
                <legend>Empty value prop string</legend>
                <input value="" required={true} />
              </fieldset>
              <fieldset>
                <legend>No value prop</legend>
                <input required={true} />
              </fieldset>
              <fieldset>
                <legend>Empty defaultValue prop string</legend>
                <input required={true} defaultValue="" />
              </fieldset>
              <fieldset>
                <legend>No value prop date input</legend>
                <input type="date" required={true} />
              </fieldset>
              <fieldset>
                <legend>Empty value prop date input</legend>
                <input type="date" value="" required={true} />
              </fieldset>
            </form>
          </Fixture>

Domain

Frequently Asked Questions

What is the TextInputFixtures class?
TextInputFixtures is a class in the react codebase, defined in fixtures/dom/src/components/fixtures/text-inputs/index.js.
Where is TextInputFixtures defined?
TextInputFixtures is defined in fixtures/dom/src/components/fixtures/text-inputs/index.js at line 9.

Analyze Your Own Codebase

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

Try Supermodel Free