@@ -313,6 +313,44 @@ describe('ReactDOMFiber', () => {
313313 expect ( container . innerHTML ) . toBe ( '' ) ;
314314 } ) ;
315315
316+ xit ( 'TODO: should not apply SVG mode across portals' , ( ) => {
317+ var portalContainer = document . createElement ( 'div' ) ;
318+ var portalContainer2 = document . createElement ( 'div' ) ;
319+ var portalContainer3 = document . createElement ( 'div' ) ;
320+
321+ ReactDOM . render (
322+ < svg >
323+ < image xlinkHref = "http://i.imgur.com/w7GCRPb.png" />
324+ { ReactDOM . unstable_createPortal (
325+ < div > portal1[1]</ div > ,
326+ portalContainer
327+ ) }
328+ < image xlinkHref = "http://i.imgur.com/w7GCRPb.png" />
329+ </ svg > ,
330+ container
331+ ) ;
332+
333+ const div = portalContainer . childNodes [ 0 ] ;
334+ const image1 = container . firstChild . childNodes [ 0 ] ;
335+ const image2 = container . firstChild . childNodes [ 1 ] ;
336+ expect ( div . namespaceURI ) . toBe ( 'http://www.w3.org/1999/xhtml' ) ;
337+ expect ( div . tagName ) . toBe ( 'DIV' ) ;
338+ expect ( image1 . namespaceURI ) . toBe ( 'http://www.w3.org/2000/svg' ) ;
339+ expect ( image1 . tagName ) . toBe ( 'image' ) ;
340+ expect (
341+ image1 . getAttributeNS ( 'http://www.w3.org/1999/xlink' , 'href' )
342+ ) . toBe ( 'http://i.imgur.com/w7GCRPb.png' ) ;
343+ expect ( image2 . namespaceURI ) . toBe ( 'http://www.w3.org/2000/svg' ) ;
344+ expect ( image2 . tagName ) . toBe ( 'image' ) ;
345+ expect (
346+ image2 . getAttributeNS ( 'http://www.w3.org/1999/xlink' , 'href' )
347+ ) . toBe ( 'http://i.imgur.com/w7GCRPb.png' ) ;
348+
349+ ReactDOM . unmountComponentAtNode ( container ) ;
350+ expect ( portalContainer . innerHTML ) . toBe ( '' ) ;
351+ expect ( container . innerHTML ) . toBe ( '' ) ;
352+ } ) ;
353+
316354 it ( 'should pass portal context when rendering subtree elsewhere' , ( ) => {
317355 var portalContainer = document . createElement ( 'div' ) ;
318356
0 commit comments