Closed JElgar closed 3 weeks ago
They seem to be correctly wrapped for both current version and your version (keep in mind SelectWrapper extends that class)
Could it be because of the async test callback? (I don't think it should affect it but no idea)
For maintainers: I wonder if this test has the same issue?
Disclaimer: I'm not a mantainer for this package
I've taken a bit more of a look into this and I can indeed recreate it, although in vitest only: it doesn't occur in our own tests, but they use jest.
I have a feeling it has something to do with our use of motion/transitions in the component, but usual things like disabling motion or fake timers don't seem to help. I'll continue to look into this a bit further.
We are continuing to investigate fixing this internally, but as a workaround, you can get rid of the warnings by wrapping open/close dropdown actions in an async act
call:
test('thing', async () => {
const { container } = render(<TestThing />);
const select = wrapper(container).findSelect()!;
await act(async () => select.openDropdown()};
await act(async () => select.closeDropdown()};
});
Thanks @gethinwebster. That work around works! Head us that Ive also observed this issue with dialogs. Would it make sense to keep this issue open until a fix is released or is that not how you do things around here?
Browser
No response
Package version
3.0.1335
React version
18.3.1
Description
When using test utils dom, opening and then closing a dialog has the following warning
Warning: An update to Transition inside a test was not wrapped in act(...)
. This may be related to https://github.com/cloudscape-design/components/issues/2471?Source code
No response
Reproduction
Code of Conduct