TextAreaFixtures Class — react Architecture
Architecture documentation for the TextAreaFixtures class in index.js from the react codebase.
Entity Profile
Dependency Diagram
graph TD 7f135a78_57d4_f5af_55cc_bd6acadb7fb6["TextAreaFixtures"] 44bbe3e9_827e_bc9b_a55c_b1eb9829c3b4["index.js"] 7f135a78_57d4_f5af_55cc_bd6acadb7fb6 -->|defined in| 44bbe3e9_827e_bc9b_a55c_b1eb9829c3b4 71acc424_3d59_1e96_4f61_9396da8d56de["render()"] 7f135a78_57d4_f5af_55cc_bd6acadb7fb6 -->|method| 71acc424_3d59_1e96_4f61_9396da8d56de
Relationship Graph
Source Code
fixtures/dom/src/components/fixtures/textareas/index.js lines 7–84
export default class TextAreaFixtures extends React.Component {
state = {value: ''};
onChange = event => {
this.setState({value: event.target.value});
};
render() {
return (
<FixtureSet title="Textareas">
<TestCase
title="Kitchen Sink"
description="Verify that the controlled textarea displays its value under 'Controlled Output', and that both textareas can be typed in">
<div>
<form className="container">
<fieldset>
<legend>Controlled</legend>
<textarea value={this.state.value} onChange={this.onChange} />
</fieldset>
<fieldset>
<legend>Uncontrolled</legend>
<textarea defaultValue="" />
</fieldset>
</form>
<div className="container">
<h4>Controlled Output:</h4>
<div className="output">{this.state.value}</div>
</div>
</div>
</TestCase>
<TestCase title="Placeholders">
<TestCase.ExpectedResult>
The textarea should be rendered with the placeholder "Hello, world"
</TestCase.ExpectedResult>
<div style={{margin: '10px 0px'}}>
<textarea placeholder="Hello, world" />
</div>
</TestCase>
<TestCase
title="Required Textareas"
affectedBrowsers="Firefox"
relatedIssues="16402">
<TestCase.Steps>
<li>View this test in Firefox</li>
</TestCase.Steps>
<TestCase.ExpectedResult>
You should{' '}
<b>
<i>not</i>
</b>{' '}
see a red aura on initial page load, indicating the textarea is
invalid.
<br />
This aura looks roughly like:
<textarea style={{boxShadow: '0 0 1px 1px red', marginLeft: 8}} />
</TestCase.ExpectedResult>
<Fixture>
<form className="control-box">
<fieldset>
<legend>Empty value prop string</legend>
<textarea value="" required={true} />
</fieldset>
<fieldset>
<legend>No value prop</legend>
<textarea required={true} />
</fieldset>
<fieldset>
<legend>Empty defaultValue prop string</legend>
<textarea required={true} defaultValue="" />
</fieldset>
</form>
</Fixture>
</TestCase>
</FixtureSet>
);
}
}
Domain
Source
Frequently Asked Questions
What is the TextAreaFixtures class?
TextAreaFixtures is a class in the react codebase, defined in fixtures/dom/src/components/fixtures/textareas/index.js.
Where is TextAreaFixtures defined?
TextAreaFixtures is defined in fixtures/dom/src/components/fixtures/textareas/index.js at line 7.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free