mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Be consistent with object naming in tests
This also fixes line length issues our linter was complaining about.
This commit is contained in:
@@ -64,14 +64,14 @@ describe('ReactDOMInput', function() {
|
||||
expect(node.value).toBe('false');
|
||||
});
|
||||
|
||||
it('should display "foobar" for `defaultValue` of `objectToString`', function() {
|
||||
var objectToString = {
|
||||
it('should display "foobar" for `defaultValue` of `objToString`', function() {
|
||||
var objToString = {
|
||||
toString: function() {
|
||||
return "foobar";
|
||||
}
|
||||
};
|
||||
|
||||
var stub = <input type="text" defaultValue={objectToString} />;
|
||||
var stub = <input type="text" defaultValue={objToString} />;
|
||||
var node = renderTextInput(stub);
|
||||
|
||||
expect(node.value).toBe('foobar');
|
||||
@@ -104,19 +104,19 @@ describe('ReactDOMInput', function() {
|
||||
expect(node.value).toEqual('false');
|
||||
});
|
||||
|
||||
it('should allow setting `value` to `objectToString`', function() {
|
||||
it('should allow setting `value` to `objToString`', function() {
|
||||
var stub = <input type="text" value="foo" />;
|
||||
var node = renderTextInput(stub);
|
||||
|
||||
expect(node.value).toBe('foo');
|
||||
|
||||
var objectToString = {
|
||||
var objToString = {
|
||||
toString: function() {
|
||||
return "foobar";
|
||||
}
|
||||
};
|
||||
|
||||
stub.replaceProps({value: objectToString});
|
||||
stub.replaceProps({value: objToString});
|
||||
expect(node.value).toEqual('foobar');
|
||||
});
|
||||
|
||||
|
||||
@@ -69,14 +69,14 @@ describe('ReactDOMTextarea', function() {
|
||||
expect(node.value).toBe('false');
|
||||
});
|
||||
|
||||
it('should display "foobar" for `defaultValue` of `objectToString`', function() {
|
||||
var objectToString = {
|
||||
it('should display "foobar" for `defaultValue` of `objToString`', function() {
|
||||
var objToString = {
|
||||
toString: function() {
|
||||
return "foobar";
|
||||
}
|
||||
};
|
||||
|
||||
var stub = <textarea type="text" defaultValue={objectToString} />;
|
||||
var stub = <textarea type="text" defaultValue={objToString} />;
|
||||
var node = renderTextarea(stub);
|
||||
|
||||
expect(node.value).toBe('foobar');
|
||||
@@ -119,18 +119,18 @@ describe('ReactDOMTextarea', function() {
|
||||
expect(node.value).toEqual('false');
|
||||
});
|
||||
|
||||
it('should allow setting `value` to `objectToString`', function() {
|
||||
it('should allow setting `value` to `objToString`', function() {
|
||||
var stub = <textarea value="giraffe" />;
|
||||
var node = renderTextarea(stub);
|
||||
|
||||
expect(node.value).toBe('giraffe');
|
||||
|
||||
var obj = {
|
||||
var objToString = {
|
||||
toString: function() {
|
||||
return "foo";
|
||||
}
|
||||
};
|
||||
stub.replaceProps({value: obj});
|
||||
stub.replaceProps({value: objToString});
|
||||
expect(node.value).toEqual('foo');
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user