diff options
Diffstat (limited to 'packages/astro/test/react-component.test.js')
-rw-r--r-- | packages/astro/test/react-component.test.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/packages/astro/test/react-component.test.js b/packages/astro/test/react-component.test.js index 7205b0342..3565342c2 100644 --- a/packages/astro/test/react-component.test.js +++ b/packages/astro/test/react-component.test.js @@ -42,16 +42,21 @@ describe('React Components', () => { expect($('#pure')).to.have.lengthOf(1); // test 8: Check number of islands - expect($('astro-island[uid]')).to.have.lengthOf(7); + expect($('astro-island[uid]')).to.have.lengthOf(9); // test 9: Check island deduplication const uniqueRootUIDs = new Set($('astro-island').map((i, el) => $(el).attr('uid'))); - expect(uniqueRootUIDs.size).to.equal(6); + expect(uniqueRootUIDs.size).to.equal(8); // test 10: Should properly render children passed as props const islandsWithChildren = $('.with-children'); expect(islandsWithChildren).to.have.lengthOf(2); expect($(islandsWithChildren[0]).html()).to.equal($(islandsWithChildren[1]).html()); + + // test 11: Should generate unique React.useId per island + const islandsWithId = $('.react-use-id'); + expect(islandsWithId).to.have.lengthOf(2); + expect($(islandsWithId[0]).attr('id')).to.not.equal($(islandsWithId[1]).attr('id')) }); it('Can load Vue', async () => { |