From 8f4c2997a028e0908bc85d4cfa3d8b97c47f3fb8 Mon Sep 17 00:00:00 2001 From: Joshua Evans Date: Fri, 9 Oct 2015 19:37:58 +0100 Subject: [PATCH] add test to show `this` is indeed undefined - closes #3613 --- .../client/wrappers/__tests__/ReactDOMInput-test.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/renderers/dom/client/wrappers/__tests__/ReactDOMInput-test.js b/src/renderers/dom/client/wrappers/__tests__/ReactDOMInput-test.js index e13691969c..affc51a259 100644 --- a/src/renderers/dom/client/wrappers/__tests__/ReactDOMInput-test.js +++ b/src/renderers/dom/client/wrappers/__tests__/ReactDOMInput-test.js @@ -279,6 +279,17 @@ describe('ReactDOMInput', function() { expect(console.error.argsForCall.length).toBe(1); }); + it('should have a this value of undefined if bind is not used', function() { + var unboundInputOnChange = function() { + expect(this).toBe(undefined); + }; + + var instance = ; + instance = ReactTestUtils.renderIntoDocument(instance); + + ReactTestUtils.Simulate.change(instance); + }); + it('should throw if both value and valueLink are provided', function() { var node = document.createElement('div'); var link = new ReactLink('yolo', mocks.getMockFunction());