From 8ee2d811431842864149a3ccd4c446038aed09bf Mon Sep 17 00:00:00 2001 From: Pavel Feldman Date: Wed, 17 Jan 2024 12:53:01 -0800 Subject: [PATCH] cherry-pick(#29026): test: add a props.children test --- .../playwright.ct-react.spec.ts | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/playwright-test/playwright.ct-react.spec.ts b/tests/playwright-test/playwright.ct-react.spec.ts index 04ddcc7f59..f565c80ea2 100644 --- a/tests/playwright-test/playwright.ct-react.spec.ts +++ b/tests/playwright-test/playwright.ct-react.spec.ts @@ -495,3 +495,23 @@ test('should normalize children', async ({ runInlineTest }) => { expect(result.exitCode).toBe(0); expect(result.passed).toBe(2); }); + +test('should allow props children', async ({ runInlineTest }) => { + const result = await runInlineTest({ + 'playwright.config.ts': playwrightConfig, + 'playwright/index.html': ``, + 'playwright/index.ts': ``, + 'src/component.spec.tsx': ` + import { test, expect } from '@playwright/experimental-ct-react'; + + test("renders children from props object", async ({ mount, page }) => { + const props = { children: 'test' }; + await mount(