Be consistent with object naming in tests
This also fixes line length issues our linter was complaining about.
Paul O’Shannessy committed
Oct 15, 2013 at 10:42 UTC
b0645bd5d3bbea40e93194a6c403ce3ba633d45a
2 files changed
+12
-12
src/dom/components/__tests__/ReactDOMInput-test.js
+6
-6
@@ -64,14 +64,14 @@ describe('ReactDOMInput', function() {
64
expect(node.value).toBe('false');
65
});
66
67
- it('should display "foobar" for `defaultValue` of `objectToString`', function() {
68
- var objectToString = {
67
+ it('should display "foobar" for `defaultValue` of `objToString`', function() {
68
+ var objToString = {
69
toString: function() {
70
return "foobar";
71
}
72
};
73
74
- var stub = <input type="text" defaultValue={objectToString} />;
74
+ var stub = <input type="text" defaultValue={objToString} />;
75
var node = renderTextInput(stub);
76
77
expect(node.value).toBe('foobar');
@@ -104,19 +104,19 @@ describe('ReactDOMInput', function() {
104
expect(node.value).toEqual('false');
105
});
106
107
- it('should allow setting `value` to `objectToString`', function() {
107
+ it('should allow setting `value` to `objToString`', function() {
108
var stub = <input type="text" value="foo" />;
109
var node = renderTextInput(stub);
110
111
expect(node.value).toBe('foo');
112
113
- var objectToString = {
113
+ var objToString = {
114
toString: function() {
115
return "foobar";
116
}
117
};
118
119
- stub.replaceProps({value: objectToString});
119
+ stub.replaceProps({value: objToString});
120
expect(node.value).toEqual('foobar');
121
});
122
src/dom/components/__tests__/ReactDOMTextarea-test.js
+6
-6
@@ -69,14 +69,14 @@ describe('ReactDOMTextarea', function() {
69
expect(node.value).toBe('false');
70
});
71
72
- it('should display "foobar" for `defaultValue` of `objectToString`', function() {
73
- var objectToString = {
72
+ it('should display "foobar" for `defaultValue` of `objToString`', function() {
73
+ var objToString = {
74
toString: function() {
75
return "foobar";
76
}
77
};
78
79
- var stub = <textarea type="text" defaultValue={objectToString} />;
79
+ var stub = <textarea type="text" defaultValue={objToString} />;
80
var node = renderTextarea(stub);
81
82
expect(node.value).toBe('foobar');
@@ -119,18 +119,18 @@ describe('ReactDOMTextarea', function() {
119
expect(node.value).toEqual('false');
120
});
121
122
- it('should allow setting `value` to `objectToString`', function() {
122
+ it('should allow setting `value` to `objToString`', function() {
123
var stub = <textarea value="giraffe" />;
124
var node = renderTextarea(stub);
125
126
expect(node.value).toBe('giraffe');
127
128
- var obj = {
128
+ var objToString = {
129
toString: function() {
130
return "foo";
131
}
132
};
133
- stub.replaceProps({value: obj});
133
+ stub.replaceProps({value: objToString});
134
expect(node.value).toEqual('foo');
135
});
136