From 4e5ed8317ba40000ac005457824da6a49b6429e3 Mon Sep 17 00:00:00 2001 From: Ben Alpert Date: Mon, 19 May 2014 16:56:30 -0700 Subject: [PATCH] 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`. --- src/browser/ui/__tests__/ReactDOMComponent-test.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/browser/ui/__tests__/ReactDOMComponent-test.js b/src/browser/ui/__tests__/ReactDOMComponent-test.js index ccc279f2e2..8111c22218 100644 --- a/src/browser/ui/__tests__/ReactDOMComponent-test.js +++ b/src/browser/ui/__tests__/ReactDOMComponent-test.js @@ -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(
); 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() {