summaryrefslogtreecommitdiff
path: root/packages/integrations/react/test/react-component.test.js
diff options
context:
space:
mode:
authorGravatar Matthew Phillips <matthew@skypack.dev> 2023-10-24 08:05:19 -0400
committerGravatar GitHub <noreply@github.com> 2023-10-24 08:05:19 -0400
commit4dee38711cbf83efb5e12fbfa8e69e2495c49acf (patch)
tree05de3ac83e729935ab72cd2ada07e03ddcb0c3d8 /packages/integrations/react/test/react-component.test.js
parent5dd1ed50b2f9428946b0b273e0ce8f13c19aa3b5 (diff)
downloadastro-4dee38711cbf83efb5e12fbfa8e69e2495c49acf.tar.gz
astro-4dee38711cbf83efb5e12fbfa8e69e2495c49acf.tar.zst
astro-4dee38711cbf83efb5e12fbfa8e69e2495c49acf.zip
Fix client hydration in experimentalReactChildren (#8898)
* Fix client hydration in experimentalReactChildren * Add tests * Add a changeset * Use recursion instead of walking * getChildren -> swap order --------- Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
Diffstat (limited to 'packages/integrations/react/test/react-component.test.js')
-rw-r--r--packages/integrations/react/test/react-component.test.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/packages/integrations/react/test/react-component.test.js b/packages/integrations/react/test/react-component.test.js
index 43df1d9e4..96d60fd54 100644
--- a/packages/integrations/react/test/react-component.test.js
+++ b/packages/integrations/react/test/react-component.test.js
@@ -105,7 +105,13 @@ describe('React Components', () => {
it('Children are parsed as React components, can be manipulated', async () => {
const html = await fixture.readFile('/children/index.html');
const $ = cheerioLoad(html);
- expect($('.with-children-count').text()).to.equal('2');
+ expect($('#one .with-children-count').text()).to.equal('2');
+ });
+
+ it('Client children passes option to the client', async () => {
+ const html = await fixture.readFile('/children/index.html');
+ const $ = cheerioLoad(html);
+ expect($('[data-react-children]')).to.have.lengthOf(1);
});
});