我目前正在使用getByTestId()在我的React应用程序中进行测试。测试看起来像这样: it('should be truthy when clicking to play or pause if "hasVideo" is true', () => { hasVideo: true render(<VideoCardForm {...newProps} />);
const videoEl = screen.getByTestId('video-play-pa
通过以用户为中心的方法,我对RTL的理解是,元素的测试排序应该看起来像这样。 const foo = queryByText('foo');expect(foo).toBeInTheDocument();expect(foo).toShowBefore(bar); // THIS IS MY PSEUDOCODE 然而,我在RTL语言中找不到.toShowBefore()或等效的函数。测试内容是否按特定顺序显示的正确方法是什么?