mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
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`.
This commit is contained in:
@@ -70,7 +70,7 @@ describe('ReactDOMComponent', function() {
|
||||
});
|
||||
|
||||
it("should update styles when mutating style object", function() {
|
||||
var styles = { display: 'none', fontFamily: 'Arial', opacity: 0 };
|
||||
var styles = { display: 'none', fontFamily: 'Arial', lineHeight: 1.2 };
|
||||
var stub = ReactTestUtils.renderIntoDocument(<div style={styles} />);
|
||||
|
||||
var stubStyle = stub.getDOMNode().style;
|
||||
@@ -82,21 +82,21 @@ describe('ReactDOMComponent', function() {
|
||||
stub.receiveComponent({props: { style: styles }}, transaction);
|
||||
expect(stubStyle.display).toEqual('block');
|
||||
expect(stubStyle.fontFamily).toEqual('Arial');
|
||||
expect(stubStyle.opacity).toEqual('0');
|
||||
expect(stubStyle.lineHeight).toEqual('1.2');
|
||||
|
||||
styles.fontFamily = 'Helvetica';
|
||||
|
||||
stub.receiveComponent({props: { style: styles }}, transaction);
|
||||
expect(stubStyle.display).toEqual('block');
|
||||
expect(stubStyle.fontFamily).toEqual('Helvetica');
|
||||
expect(stubStyle.opacity).toEqual('0');
|
||||
expect(stubStyle.lineHeight).toEqual('1.2');
|
||||
|
||||
styles.opacity = 0.5;
|
||||
styles.lineHeight = 0.5;
|
||||
|
||||
stub.receiveComponent({props: { style: styles }}, transaction);
|
||||
expect(stubStyle.display).toEqual('block');
|
||||
expect(stubStyle.fontFamily).toEqual('Helvetica');
|
||||
expect(stubStyle.opacity).toEqual('0.5');
|
||||
expect(stubStyle.lineHeight).toEqual('0.5');
|
||||
});
|
||||
|
||||
it("should update styles if initially null", function() {
|
||||
|
||||
Reference in New Issue
Block a user