@samitouri / QOS-React-2 / commits / 5790a75622

Fix submit-button value test in IE10

Test Plan: Ran test in jest, phantomjs, IE10, Chrome, and Firefox.

Ben Alpert committed Jun 7, 2014 at 18:50 UTC 5790a756224b64ed07ff72fcc305ddc697e16b27
1 file changed +6 -2
src/browser/ui/dom/components/__tests__/ReactDOMInput-test.js
+6 -2
@@ -136,8 +136,12 @@ describe('ReactDOMInput', function() {
136 var node = stub.getDOMNode();
137
138 // The value shouldn't be '', or else the button will have no text; it
139 - // should have the default "Submit" or "Submit Query" label
140 - expect(node.hasAttribute('value')).toBe(false);
139 + // should have the default "Submit" or "Submit Query" label. Most browsers
140 + // report this as not having a `value` attribute at all; IE reports it as
141 + // the actual label that the user sees.
142 + expect(
143 + !node.hasAttribute('value') || node.getAttribute('value').length > 0
144 + ).toBe(true);
145 });
146
147 it('should control radio buttons', function() {