From 5e8beec84b83d6f1836071b5c187fbd95a839b96 Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Thu, 2 Aug 2018 02:46:08 +0100 Subject: [PATCH] Add a regression test for #11602 --- .../ReactDOMServerIntegrationForms-test.js | 35 +++++++++++++------ 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationForms-test.js b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationForms-test.js index 0f6a0cab49dab..6e2d95fe50e54 100644 --- a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationForms-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationForms-test.js @@ -414,20 +414,35 @@ describe('ReactDOMServerIntegration', () => { }, ); - itRenders('an option with flattened children', async render => { + itRenders('a select option with flattened children', async render => { const e = await render( - + , - 1, ); - expect(e.getAttribute('value')).toBe(null); - expect(e.getAttribute('defaultValue')).toBe(null); - expect(e.firstChild.innerHTML).toBe('BarFooBaz'); - expect(e.firstChild.selected).toBe(true); + const option = e.options[0]; + expect(option.childNodes.length).toBe(1); + expect(option.childNodes[0].nodeType).toBe(3); + expect(option.childNodes[0].nodeValue).toBe('A B'); }); + + itRenders( + 'a select option with flattened children and a warning', + async render => { + const e = await render( + , + 1, + ); + expect(e.getAttribute('value')).toBe(null); + expect(e.getAttribute('defaultValue')).toBe(null); + expect(e.firstChild.innerHTML).toBe('BarFooBaz'); + expect(e.firstChild.selected).toBe(true); + }, + ); }); describe('user interaction', function() {