我有一个React组件,它将另一个组件作为道具,当我尝试在Playwright中渲染它时,我得到了一个错误。
第一个
我的期望是这个测试应该通过,因为它应该在MyComponent
中呈现SubComponent
。但是,它失败了,并出现错误:
undefined: Error: Minified React error #152; visit https://reactjs.org/docs/error-decoder.html?invariant=152&args[]=Component for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
6 | test.describe('My Component', () => {
7 | test('it should render', async ({ mount, page }) => {
> 8 | const component = await mount(
| ^
9 | <MyComponent SubComponent={TestSubComponent} />
10 | );
11 | await expect(component).toContainText('Hello');
React错误被缩小,所以很难判断出了什么问题。
有什么问题吗?
1条答案
按热度按时间bf1o4zei1#
这是一个错误。在GitHub上出现的问题如下:https://github.com/microsoft/playwright/issues/15620