Merge pull request #16495 from agentbellnorm/fix-addons-test-util

[TechDocs] Fix addons test util
This commit is contained in:
Morgan Bentell
2023-02-21 14:08:02 +01:00
committed by GitHub
2 changed files with 9 additions and 4 deletions
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import React, { ReactElement, Fragment } from 'react';
import React, { ReactElement } from 'react';
// Shadow DOM support for the simple and complete DOM testing utilities
// https://github.com/testing-library/dom-testing-library/issues/742#issuecomment-674987855
@@ -236,9 +236,9 @@ export class TechDocsAddonTester {
element={<TechDocsReaderPage />}
>
<TechDocsAddons>
{this.addons.map((addon, index) => (
<Fragment key={index}>{addon}</Fragment>
))}
{this.addons.map((addon, index) =>
React.cloneElement(addon, { key: index }),
)}
</TechDocsAddons>
</Route>
</FlatRoutes>