Switch style test to pass in jsdom
This should be testing approximately the same thing and passes in Jest. Test Plan: Cherry-pick Jest config from #1528 and verify that running `jest`.
Ben Alpert committed
May 19, 2014 at 16:56 UTC
4e5ed8317ba40000ac005457824da6a49b6429e3
1 file changed
+5
-5
src/browser/ui/__tests__/ReactDOMComponent-test.js
+5
-5
@@ -70,7 +70,7 @@ describe('ReactDOMComponent', function() {
70
});
71
72
it("should update styles when mutating style object", function() {
73
- var styles = { display: 'none', fontFamily: 'Arial', opacity: 0 };
73
+ var styles = { display: 'none', fontFamily: 'Arial', lineHeight: 1.2 };
74
var stub = ReactTestUtils.renderIntoDocument(<div style={styles} />);
75
76
var stubStyle = stub.getDOMNode().style;
@@ -82,21 +82,21 @@ describe('ReactDOMComponent', function() {
82
stub.receiveComponent({props: { style: styles }}, transaction);
83
expect(stubStyle.display).toEqual('block');
84
expect(stubStyle.fontFamily).toEqual('Arial');
85
- expect(stubStyle.opacity).toEqual('0');
85
+ expect(stubStyle.lineHeight).toEqual('1.2');
86
87
styles.fontFamily = 'Helvetica';
88
89
stub.receiveComponent({props: { style: styles }}, transaction);
90
expect(stubStyle.display).toEqual('block');
91
expect(stubStyle.fontFamily).toEqual('Helvetica');
92
- expect(stubStyle.opacity).toEqual('0');
92
+ expect(stubStyle.lineHeight).toEqual('1.2');
93
94
- styles.opacity = 0.5;
94
+ styles.lineHeight = 0.5;
95
96
stub.receiveComponent({props: { style: styles }}, transaction);
97
expect(stubStyle.display).toEqual('block');
98
expect(stubStyle.fontFamily).toEqual('Helvetica');
99
- expect(stubStyle.opacity).toEqual('0.5');
99
+ expect(stubStyle.lineHeight).toEqual('0.5');
100
});
101
102
it("should update styles if initially null", function() {