You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The component is exactly the same, except now show is also a prop. The component can be rendered by either clicking the button, or if the parent changes the exposed variable to true
test('on:introend with prop change',async()=>{const{ rerender }=render(Transitioner);// at this point the container innerHTML is: <div><button>Show</button> </div>rerender({show: true});// at this point the container innerHTML is: <div><button>Show</button> <div><p data-testid="intro-pending">Pending</p></div></div>// this expectation is OKconstpending=screen.getByTestId('intro-pending');expect(pending).toBeInTheDocument();awaitwaitFor(()=>{constdone=screen.queryByTestId('intro-done');// However, this one failsexpect(done).toBeInTheDocument();});});
The text was updated successfully, but these errors were encountered:
@yanick I agree, this is a bug in @cortopy's test. rerender needs an await or to be used inside act for changes to hit the DOM. I think this issue can be closed
As per #311, "introend" tests seem to work fine.
However, in this scenario the tests break.
The component is exactly the same, except now
show
is also a prop. The component can be rendered by either clicking the button, or if the parent changes the exposed variable totrue
The text was updated successfully, but these errors were encountered: