I'm running into some issues with a test I'm trying to create.
This is what my test currently looks like:
it('Test Cancel on Modal', async () => {
act(() => {
render(
<MyPage />
);
});
const btnAdd = screen.getAllByTestId('AddNewWidget')[0];
await act(async () => {
fireEvent.click(btnAdd);
});
//screen.debug(undefined, 300000);
const btnCancel = screen.getAllByTestId('btnCancel')[0];
await act(async () => {
fireEvent.click(btnCancel);
});
//screen.debug(undefined, 300000);
jest.resetAllMocks();
});
When I review the output of the screen.debug, I'm seeing the following:
<div
class="MuiModal-root MuiDialog-root css-v61v4w-MuiModal-root-MuiDialog-root"
role="presentation"
>
<div
aria-hidden="true"
class="MuiBackdrop-root css-1am3qag-MuiBackdrop-root-MuiDialog-backdrop"
style="opacity: 0; webkit-transition: opacity 195ms cubic-bezier(0.4, 0, 0.2, 1) 0ms; transition: opacity 195ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;"
/>
I'm trying to see what the opacity is on a div with the classname of ""MuiBackdrop-root css-1am3qag-MuiBackdrop-root-MuiDialog-backdrop"
Unfortunately, I'm not seeing a way on how to do this.
Could someone please give me some pointers?