diff options
Diffstat (limited to 'packages/astro/test/react-component.test.js')
-rw-r--r-- | packages/astro/test/react-component.test.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/packages/astro/test/react-component.test.js b/packages/astro/test/react-component.test.js index 93f464d3c..b5e01e638 100644 --- a/packages/astro/test/react-component.test.js +++ b/packages/astro/test/react-component.test.js @@ -39,9 +39,20 @@ React('Can load React', async () => { const $ = doc(result.contents); assert.equal($('#react-h2').text(), 'Hello world!'); + assert.equal($('#react-h2').attr('data-reactroot'), undefined, 'no reactroot'); assert.equal($('#arrow-fn-component').length, 1, 'Can use function components'); }); +React('Includes reactroot on hydrating components', async () => { + const result = await runtime.load('/'); + if (result.error) throw new Error(result.error); + + const $ = doc(result.contents); + const div = $('#research'); + assert.equal(div.attr('data-reactroot'), '', 'Has the hydration attr'); + assert.equal(div.html(), 'foo bar <!-- -->1'); +}) + React('Throws helpful error message on window SSR', async () => { const result = await runtime.load('/window'); assert.match( |